Skip to content

Commit

Permalink
fix: warnings in xunit tests due to unused theory params (#297)
Browse files Browse the repository at this point in the history
Signed-off-by: Andrei de la Cruz <[email protected]>
  • Loading branch information
jeandreidc authored Oct 18, 2024
1 parent 90aac6a commit 3095caf
Showing 1 changed file with 18 additions and 16 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// ReSharper disable RedundantUsingDirective

using System.Net;
using System.Net.Http;
using Flipt.Rest;
Expand All @@ -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<IFliptClientWrapper>();
mockFliptClientWrapper.Setup(fcw =>
Expand Down Expand Up @@ -69,21 +71,21 @@ public async Task EvaluateBooleanAsync_GivenNonExistentFlag_ShouldReturnDefaultV

var fliptToOpenFeature = new FliptToOpenFeatureConverter(mockFliptClientWrapper.Object);
var resolution = async Task<ResolutionDetails<bool>>() =>
await fliptToOpenFeature.EvaluateBooleanAsync("flagKey", fallBackValue);
await fliptToOpenFeature.EvaluateBooleanAsync(flagKey, fallBackValue);

await resolution.Should().ThrowAsync<HttpRequestException>();
}

// 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<IFliptClientWrapper>();
mockFliptClientWrapper.Setup(fcw =>
Expand Down Expand Up @@ -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<string, Value>
{
Expand Down

0 comments on commit 3095caf

Please sign in to comment.