Skip to content

Commit 9ffd149

Browse files
committed
Move to Extensions folder
Signed-off-by: André Silva <2493377+askpt@users.noreply.github.com>
1 parent a38e126 commit 9ffd149

File tree

6 files changed

+29
-29
lines changed

6 files changed

+29
-29
lines changed
Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
using System.ComponentModel;
2-
3-
namespace OpenFeature.Extension;
4-
5-
internal static class EnumExtensions
6-
{
7-
public static string GetDescription(this Enum value)
8-
{
9-
var field = value.GetType().GetField(value.ToString());
10-
var attribute = field?.GetCustomAttributes(typeof(DescriptionAttribute), false).FirstOrDefault() as DescriptionAttribute;
11-
return attribute?.Description ?? value.ToString();
12-
}
13-
}
1+
using System.ComponentModel;
2+
3+
namespace OpenFeature.Extensions;
4+
5+
internal static class EnumExtensions
6+
{
7+
public static string GetDescription(this Enum value)
8+
{
9+
var field = value.GetType().GetField(value.ToString());
10+
var attribute = field?.GetCustomAttributes(typeof(DescriptionAttribute), false).FirstOrDefault() as DescriptionAttribute;
11+
return attribute?.Description ?? value.ToString();
12+
}
13+
}
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
using OpenFeature.Model;
2-
3-
namespace OpenFeature.Extension;
4-
5-
internal static class ResolutionDetailsExtensions
6-
{
7-
public static FlagEvaluationDetails<T> ToFlagEvaluationDetails<T>(this ResolutionDetails<T> details)
8-
{
9-
return new FlagEvaluationDetails<T>(details.FlagKey, details.Value, details.ErrorType, details.Reason,
10-
details.Variant, details.ErrorMessage, details.FlagMetadata);
11-
}
12-
}
1+
using OpenFeature.Model;
2+
3+
namespace OpenFeature.Extensions;
4+
5+
internal static class ResolutionDetailsExtensions
6+
{
7+
public static FlagEvaluationDetails<T> ToFlagEvaluationDetails<T>(this ResolutionDetails<T> details)
8+
{
9+
return new FlagEvaluationDetails<T>(details.FlagKey, details.Value, details.ErrorType, details.Reason,
10+
details.Variant, details.ErrorMessage, details.FlagMetadata);
11+
}
12+
}

src/OpenFeature/OpenFeatureClient.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
using Microsoft.Extensions.Logging.Abstractions;
55
using OpenFeature.Constant;
66
using OpenFeature.Error;
7-
using OpenFeature.Extension;
7+
using OpenFeature.Extensions;
88
using OpenFeature.Model;
99

1010
namespace OpenFeature;

test/OpenFeature.E2ETests/Steps/EvaluationStepDefinitions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
using OpenFeature.Constant;
22
using OpenFeature.E2ETests.Utils;
3-
using OpenFeature.Extension;
3+
using OpenFeature.Extensions;
44
using OpenFeature.Model;
55

66
namespace OpenFeature.E2ETests.Steps;

test/OpenFeature.Tests/FeatureProviderExceptionTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
using OpenFeature.Constant;
22
using OpenFeature.Error;
3-
using OpenFeature.Extension;
3+
using OpenFeature.Extensions;
44

55
namespace OpenFeature.Tests;
66

test/OpenFeature.Tests/OpenFeatureClientTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
using NSubstitute.ExceptionExtensions;
66
using OpenFeature.Constant;
77
using OpenFeature.Error;
8-
using OpenFeature.Extension;
8+
using OpenFeature.Extensions;
99
using OpenFeature.Model;
1010
using OpenFeature.Tests.Internal;
1111

0 commit comments

Comments
 (0)