Skip to content

Commit

Permalink
Update namespace from OpenFeature -> OpenFeatureSDK
Browse files Browse the repository at this point in the history
It recommended not to share a namespace and class name to avoid import issues, and code like OpenFeature.OpenFeature.Instace.*

Signed-off-by: Benjamin Evenson <2031163+benjiro@users.noreply.github.com>
  • Loading branch information
benjiro committed Jul 17, 2022
1 parent 4446810 commit 5725c07
Show file tree
Hide file tree
Showing 29 changed files with 73 additions and 64 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ The packages will aim to support all current .NET versions. Refer to the current
## Basic Usage

```csharp
using OpenFeatureSDK;

OpenFeature.Instance.SetProvider(new NoOpProvider());
var client = OpenFeature.Instance.GetClient();

Expand Down
2 changes: 1 addition & 1 deletion src/OpenFeature/Constant/ErrorType.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System.ComponentModel;

namespace OpenFeature.Constant
namespace OpenFeatureSDK.Constant
{
/// <summary>
/// These errors are used to indicate abnormal execution when evaluation a flag
Expand Down
2 changes: 1 addition & 1 deletion src/OpenFeature/Constant/FlagValueType.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace OpenFeature.Constant
namespace OpenFeatureSDK.Constant
{
/// <summary>
/// Used to identity what object type of flag being evaluated
Expand Down
2 changes: 1 addition & 1 deletion src/OpenFeature/Constant/NoOpProvider.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace OpenFeature.Constant
namespace OpenFeatureSDK.Constant
{
internal static class NoOpProvider
{
Expand Down
2 changes: 1 addition & 1 deletion src/OpenFeature/Constant/Reason.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace OpenFeature.Constant
namespace OpenFeatureSDK.Constant
{
/// <summary>
/// Common reasons used during flag resolution
Expand Down
6 changes: 3 additions & 3 deletions src/OpenFeature/Error/FeatureProviderException.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
using System;
using OpenFeature.Constant;
using OpenFeature.Extension;
using OpenFeatureSDK.Constant;
using OpenFeatureSDK.Extension;

namespace OpenFeature.Error
namespace OpenFeatureSDK.Error
{
/// <summary>
/// Used to represent an abnormal error when evaluating a flag. This exception should be thrown
Expand Down
2 changes: 1 addition & 1 deletion src/OpenFeature/Extension/EnumExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using System.ComponentModel;
using System.Linq;

namespace OpenFeature.Extension
namespace OpenFeatureSDK.Extension
{
internal static class EnumExtensions
{
Expand Down
4 changes: 2 additions & 2 deletions src/OpenFeature/Extension/ResolutionDetailsExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using OpenFeature.Model;
using OpenFeatureSDK.Model;

namespace OpenFeature.Extension
namespace OpenFeatureSDK.Extension
{
internal static class ResolutionDetailsExtensions
{
Expand Down
4 changes: 2 additions & 2 deletions src/OpenFeature/Hook.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using OpenFeature.Model;
using OpenFeatureSDK.Model;

namespace OpenFeature
namespace OpenFeatureSDK
{
internal interface IHook
{
Expand Down
4 changes: 2 additions & 2 deletions src/OpenFeature/IFeatureClient.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
using System.Collections.Generic;
using System.Threading.Tasks;
using OpenFeature.Model;
using OpenFeatureSDK.Model;

namespace OpenFeature
namespace OpenFeatureSDK
{
internal interface IFeatureClient
{
Expand Down
4 changes: 2 additions & 2 deletions src/OpenFeature/IFeatureProvider.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System.Threading.Tasks;
using OpenFeature.Model;
using OpenFeatureSDK.Model;

namespace OpenFeature
namespace OpenFeatureSDK
{
/// <summary>
/// The provider interface describes the abstraction layer for a feature flag provider.
Expand Down
2 changes: 1 addition & 1 deletion src/OpenFeature/Model/ClientMetadata.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace OpenFeature.Model
namespace OpenFeatureSDK.Model
{
/// <summary>
/// Represents the client metadata
Expand Down
2 changes: 1 addition & 1 deletion src/OpenFeature/Model/EvaluationContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;

namespace OpenFeature.Model
namespace OpenFeatureSDK.Model
{
/// <summary>
/// A KeyValuePair with a string key and object value that is used to apply user defined properties
Expand Down
2 changes: 1 addition & 1 deletion src/OpenFeature/Model/FlagEvaluationOptions.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System.Collections.Generic;

namespace OpenFeature.Model
namespace OpenFeatureSDK.Model
{
/// <summary>
/// A structure containing the one or more hooks and hook hints
Expand Down
6 changes: 3 additions & 3 deletions src/OpenFeature/Model/FlagEvalusationDetails.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using OpenFeature.Constant;
using OpenFeature.Extension;
using OpenFeatureSDK.Constant;
using OpenFeatureSDK.Extension;

namespace OpenFeature.Model
namespace OpenFeatureSDK.Model
{
/// <summary>
/// The contract returned to the caller that describes the result of the flag evaluation process.
Expand Down
4 changes: 2 additions & 2 deletions src/OpenFeature/Model/HookContext.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System;
using OpenFeature.Constant;
using OpenFeatureSDK.Constant;

namespace OpenFeature.Model
namespace OpenFeatureSDK.Model
{
/// <summary>
/// Context provided to hook execution
Expand Down
2 changes: 1 addition & 1 deletion src/OpenFeature/Model/Metadata.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace OpenFeature.Model
namespace OpenFeatureSDK.Model
{
/// <summary>
/// <see cref="OpenFeature"/> metadata
Expand Down
4 changes: 2 additions & 2 deletions src/OpenFeature/Model/ResolutionDetails.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using OpenFeature.Constant;
using OpenFeatureSDK.Constant;

namespace OpenFeature.Model
namespace OpenFeatureSDK.Model
{
/// <summary>
/// Defines the contract that the <see cref="IFeatureProvider"/> is required to return
Expand Down
6 changes: 3 additions & 3 deletions src/OpenFeature/NoOpProvider.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
using System.Threading.Tasks;
using OpenFeature.Constant;
using OpenFeature.Model;
using OpenFeatureSDK.Constant;
using OpenFeatureSDK.Model;

namespace OpenFeature
namespace OpenFeatureSDK
{
internal class NoOpFeatureProvider : IFeatureProvider
{
Expand Down
4 changes: 2 additions & 2 deletions src/OpenFeature/OpenFeature.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
using System.Collections.Generic;
using Microsoft.Extensions.Logging;
using OpenFeature.Model;
using OpenFeatureSDK.Model;

namespace OpenFeature
namespace OpenFeatureSDK
{
/// <summary>
/// The evaluation API allows for the evaluation of feature flag values, independent of any flag control plane or vendor.
Expand Down
10 changes: 5 additions & 5 deletions src/OpenFeature/OpenFeatureClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
using System.Threading.Tasks;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Logging.Abstractions;
using OpenFeature.Constant;
using OpenFeature.Error;
using OpenFeature.Extension;
using OpenFeature.Model;
using OpenFeatureSDK.Constant;
using OpenFeatureSDK.Error;
using OpenFeatureSDK.Extension;
using OpenFeatureSDK.Model;

namespace OpenFeature
namespace OpenFeatureSDK
{
/// <summary>
///
Expand Down
6 changes: 3 additions & 3 deletions test/OpenFeature.Tests/FeatureProviderExceptionTests.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
using System;
using FluentAssertions;
using OpenFeature.Constant;
using OpenFeature.Error;
using OpenFeatureSDK.Constant;
using OpenFeatureSDK.Error;
using Xunit;

namespace OpenFeature.Tests
namespace OpenFeatureSDK.Tests
{
public class FeatureProviderExceptionTests
{
Expand Down
8 changes: 4 additions & 4 deletions test/OpenFeature.Tests/FeatureProviderTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
using AutoFixture;
using FluentAssertions;
using Moq;
using OpenFeature.Constant;
using OpenFeature.Model;
using OpenFeature.Tests.Internal;
using OpenFeatureSDK.Constant;
using OpenFeatureSDK.Model;
using OpenFeatureSDK.Tests.Internal;
using Xunit;

namespace OpenFeature.Tests
namespace OpenFeatureSDK.Tests
{
public class FeatureProviderTests
{
Expand Down
2 changes: 1 addition & 1 deletion test/OpenFeature.Tests/Internal/SpecificationAttribute.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System;

namespace OpenFeature.Tests.Internal
namespace OpenFeatureSDK.Tests.Internal
{
[AttributeUsage(AttributeTargets.Method, AllowMultiple = true, Inherited = false)]
public class SpecificationAttribute : Attribute
Expand Down
19 changes: 13 additions & 6 deletions test/OpenFeature.Tests/OpenFeatureClientTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
using FluentAssertions;
using Microsoft.Extensions.Logging;
using Moq;
using OpenFeature.Constant;
using OpenFeature.Error;
using OpenFeature.Extension;
using OpenFeature.Model;
using OpenFeature.Tests.Internal;
using OpenFeatureSDK.Constant;
using OpenFeatureSDK.Error;
using OpenFeatureSDK.Extension;
using OpenFeatureSDK.Model;
using OpenFeatureSDK.Tests.Internal;
using Xunit;

namespace OpenFeature.Tests
namespace OpenFeatureSDK.Tests
{
public class OpenFeatureClientTests
{
Expand Down Expand Up @@ -297,5 +297,12 @@ public async Task When_Exception_Occurs_During_Evaluation_Should_Return_Error()
response.Reason.Should().Be(Reason.Error);
featureProviderMock.Verify(x => x.ResolveStructureValue(flagName, defaultValue, It.IsAny<EvaluationContext>(), null), Times.Once);
}

[Fact]
public void Should_Throw_ArgumentNullException_When_Provider_Is_Null()
{
TestProvider provider = null;
Assert.Throws<ArgumentNullException>(() => new FeatureClient(provider, "test", "test" ));
}
}
}
6 changes: 3 additions & 3 deletions test/OpenFeature.Tests/OpenFeatureEvaluationContextTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
using System.Collections.Generic;
using AutoFixture;
using FluentAssertions;
using OpenFeature.Model;
using OpenFeature.Tests.Internal;
using OpenFeatureSDK.Model;
using OpenFeatureSDK.Tests.Internal;
using Xunit;

namespace OpenFeature.Tests
namespace OpenFeatureSDK.Tests
{
public class OpenFeatureEvaluationContextTests
{
Expand Down
8 changes: 4 additions & 4 deletions test/OpenFeature.Tests/OpenFeatureHookTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
using AutoFixture;
using FluentAssertions;
using Moq;
using OpenFeature.Constant;
using OpenFeature.Model;
using OpenFeature.Tests.Internal;
using OpenFeatureSDK.Constant;
using OpenFeatureSDK.Model;
using OpenFeatureSDK.Tests.Internal;
using Xunit;

namespace OpenFeature.Tests
namespace OpenFeatureSDK.Tests
{
public class OpenFeatureHookTests
{
Expand Down
8 changes: 4 additions & 4 deletions test/OpenFeature.Tests/OpenFeatureTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
using FluentAssertions;
using Microsoft.Extensions.Logging;
using Moq;
using OpenFeature.Constant;
using OpenFeature.Model;
using OpenFeature.Tests.Internal;
using OpenFeatureSDK.Constant;
using OpenFeatureSDK.Model;
using OpenFeatureSDK.Tests.Internal;
using Xunit;

namespace OpenFeature.Tests
namespace OpenFeatureSDK.Tests
{
public class OpenFeatureTests
{
Expand Down
4 changes: 2 additions & 2 deletions test/OpenFeature.Tests/TestImplementations.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using OpenFeature.Model;
using OpenFeatureSDK.Model;

namespace OpenFeature.Tests
namespace OpenFeatureSDK.Tests
{
public class TestStructure
{
Expand Down

0 comments on commit 5725c07

Please sign in to comment.