Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: warnings in xunit tests due to unused theory params #297

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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