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: flipt provider - remove unused parameters in tests #296

Closed
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
97a5970
Initial working commit without tests
jeandreidc Sep 26, 2024
c707b3e
FliptProvider: Handle type mismatch and Value casting
jeandreidc Sep 27, 2024
ee902c6
FliptProvider: Added extension to map flipt context to openFeature, a…
jeandreidc Sep 27, 2024
656711b
Added xmldoc on extension function
jeandreidc Sep 27, 2024
f17949b
Added handling of different Value types, added tests to check for pro…
jeandreidc Sep 27, 2024
7898c86
Added handling of array of Values, introduced universal deserializer …
jeandreidc Sep 27, 2024
41cf5bf
Added support to serialize nested Values list
jeandreidc Sep 27, 2024
d94a6c6
FliptProvider: Add support for serializing structure
jeandreidc Sep 27, 2024
d651b3c
FliptProvider: Implement Structure deserializer
jeandreidc Sep 27, 2024
77afc27
FliptProvider: Rename ClientWrapper to converter
jeandreidc Sep 30, 2024
a9ca17f
FliptProvider: Implemented wrapper class, added unit tests
jeandreidc Sep 30, 2024
d98f9ce
FliptProvider: Code cleanup
jeandreidc Sep 30, 2024
48c555c
FliptProvider: Extracted Converter tests to its own file
jeandreidc Oct 1, 2024
d4b3e42
Added unit tests for FliptToOpenFeature converter for variants and bo…
jeandreidc Oct 2, 2024
10b1d86
Added FliptToOpenFeatureConverter tests for non-existent flags for Va…
jeandreidc Oct 2, 2024
d8d382d
Update release metadata
jeandreidc Oct 2, 2024
204144f
Replaced Flipt package with a generated RestClient from their openapi…
jeandreidc Oct 2, 2024
563dd5f
Changed exception handling to use generated exceptions by nswag
jeandreidc Oct 2, 2024
29077ea
Modified unit test to throw mocked FliptExceptions
jeandreidc Oct 2, 2024
e11bdaa
Utilized OpenFeature Reason type on Resolutions
jeandreidc Oct 2, 2024
cd1b5a9
Change test project setting; Cleaned FLiptConverter code
jeandreidc Oct 3, 2024
83d0fde
Change types to support all .net target versions
jeandreidc Oct 3, 2024
2417a9a
FliptProvider: Update Readme
jeandreidc Oct 3, 2024
fd7210a
FliptProvider: Update ReadMe, test fliptClientWrapper calls
jeandreidc Oct 3, 2024
328c5a1
FliptProvider: Removed wrong code change in a different project
jeandreidc Oct 3, 2024
0dcca7e
lint
jeandreidc Oct 3, 2024
cc8a209
Used HttpStatusCode.Ambiguous because TooManyRequests is not yet impl…
jeandreidc Oct 3, 2024
c3d28b8
FliptProvider: Updated openapi.yaml src, regenerated RestClient using…
jeandreidc Oct 3, 2024
6633132
Update readme instructions
jeandreidc Oct 4, 2024
d8c4e85
reverted nuget.config changes, fix linting spacing issue caused by fo…
jeandreidc Oct 4, 2024
dfb13ee
Merge remote-tracking branch 'upstream/main' into feature/flipt-clien…
jeandreidc Oct 8, 2024
a5ed946
FliptProvider: Updated to throw exceptions instead of handling them a…
jeandreidc Oct 8, 2024
81b5162
FliptProvider: Moved client class generation and referencing in build…
jeandreidc Oct 8, 2024
128c142
FliptProvider: Made constructor that receives a dependent interface i…
jeandreidc Oct 8, 2024
05944bf
FliptProvider: Updated component_owners
jeandreidc Oct 8, 2024
d491ef3
Update readme
jeandreidc Oct 8, 2024
d17d2d8
Merge remote-tracking branch 'upstream/main' into feature/flipt-clien…
jeandreidc Oct 9, 2024
2110460
Reverted unintended lint changes to Flagsmith.csproj
jeandreidc Oct 10, 2024
062445a
Fixed Nswag build time error, updated README, removed openapi.yaml cu…
jeandreidc Oct 10, 2024
14a2223
lint changes in test
jeandreidc Oct 10, 2024
3224b95
Merge remote-tracking branch 'upstream/main' into feature/flipt-clien…
jeandreidc Oct 10, 2024
582a4fb
Updated System.Text.Json to latest version
jeandreidc Oct 10, 2024
09dbc34
Changed prebuild stage of nswag generation script
jeandreidc Oct 14, 2024
632210b
Use nswag msbuild variables in creating clients
jeandreidc Oct 17, 2024
92be761
Fix System.Http reference in tests
jeandreidc Oct 17, 2024
06584f7
Fix import errors on dotnet version 462
jeandreidc Oct 17, 2024
6a1f64c
Fix failing unit test caused by lint
jeandreidc Oct 17, 2024
5312d53
lint
jeandreidc Oct 17, 2024
37e35af
Fix warnings regarding unused theory params in xunit
jeandreidc Oct 18, 2024
eab1dd4
Merge remote-tracking branch 'upstream/main' into fix/flipt-provider-…
jeandreidc Oct 18, 2024
ed51049
lint
jeandreidc Oct 18, 2024
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