diff --git a/test/OpenFeature.Contrib.Providers.Flipt.Test/FliptToOpenFeatureConverterTest.cs b/test/OpenFeature.Contrib.Providers.Flipt.Test/FliptToOpenFeatureConverterTest.cs index 99573a06..e57e4d18 100644 --- a/test/OpenFeature.Contrib.Providers.Flipt.Test/FliptToOpenFeatureConverterTest.cs +++ b/test/OpenFeature.Contrib.Providers.Flipt.Test/FliptToOpenFeatureConverterTest.cs @@ -1,3 +1,5 @@ +// ReSharper disable RedundantUsingDirective + using System.Net; using System.Net.Http; using Flipt.Rest; @@ -14,13 +16,13 @@ public class FliptToOpenFeatureConverterTest { // EvaluateBooleanAsync Tests [Theory] - [InlineData(HttpStatusCode.NotFound, ErrorType.FlagNotFound, false)] - [InlineData(HttpStatusCode.BadRequest, ErrorType.TypeMismatch, false)] - [InlineData(HttpStatusCode.InternalServerError, ErrorType.ProviderNotReady, false)] - [InlineData(HttpStatusCode.Forbidden, ErrorType.ProviderNotReady, false)] - [InlineData(HttpStatusCode.Ambiguous, ErrorType.General, false)] + [InlineData(HttpStatusCode.NotFound, false)] + [InlineData(HttpStatusCode.BadRequest, false)] + [InlineData(HttpStatusCode.InternalServerError, false)] + [InlineData(HttpStatusCode.Forbidden, false)] + [InlineData(HttpStatusCode.Ambiguous, false)] public async Task EvaluateBooleanAsync_GivenHttpRequestException_ShouldHandleHttpRequestException( - HttpStatusCode thrownStatusCode, ErrorType expectedOpenFeatureErrorType, bool fallbackValue) + HttpStatusCode thrownStatusCode, bool fallbackValue) { var mockFliptClientWrapper = new Mock(); mockFliptClientWrapper.Setup(fcw => @@ -69,7 +71,7 @@ public async Task EvaluateBooleanAsync_GivenNonExistentFlag_ShouldReturnDefaultV var fliptToOpenFeature = new FliptToOpenFeatureConverter(mockFliptClientWrapper.Object); var resolution = async Task>() => - await fliptToOpenFeature.EvaluateBooleanAsync("flagKey", fallBackValue); + await fliptToOpenFeature.EvaluateBooleanAsync(flagKey, fallBackValue); await resolution.Should().ThrowAsync(); } @@ -77,13 +79,13 @@ public async Task EvaluateBooleanAsync_GivenNonExistentFlag_ShouldReturnDefaultV // EvaluateAsync Tests [Theory] - [InlineData(HttpStatusCode.NotFound, ErrorType.FlagNotFound, 0.0)] - [InlineData(HttpStatusCode.BadRequest, ErrorType.TypeMismatch, 0.0)] - [InlineData(HttpStatusCode.InternalServerError, ErrorType.ProviderNotReady, 0.0)] - [InlineData(HttpStatusCode.Forbidden, ErrorType.ProviderNotReady, 0.0)] - [InlineData(HttpStatusCode.Ambiguous, ErrorType.General, 0.0)] + [InlineData(HttpStatusCode.NotFound, 0.0)] + [InlineData(HttpStatusCode.BadRequest, 0.0)] + [InlineData(HttpStatusCode.InternalServerError, 0.0)] + [InlineData(HttpStatusCode.Forbidden, 0.0)] + [InlineData(HttpStatusCode.Ambiguous, 0.0)] public async Task EvaluateAsync_GivenHttpRequestException_ShouldHandleHttpRequestException( - HttpStatusCode thrownStatusCode, ErrorType expectedOpenFeatureErrorType, double fallbackValue) + HttpStatusCode thrownStatusCode, double fallbackValue) { var mockFliptClientWrapper = new Mock(); mockFliptClientWrapper.Setup(fcw => @@ -132,10 +134,10 @@ public async Task EvaluateAsync_GivenExistingVariantFlagAndWithAnObject_ShouldRe const string flagKey = "variant-flag"; const string variantKey = "variant-A"; const string valueFromSrc = """ - { + { "name": "Mr. Robinson", - "age": 12, - } + "age": 12, + } """; var expectedValue = new Value(new Structure(new Dictionary {