Skip to content

Commit

Permalink
Add test demonstrating ArgumentOutOfRangeException
Browse files Browse the repository at this point in the history
See: dotnet/runtime#62121, dotnet/runtime#62126

Signed-off-by: Austin Drenski <austin@austindrenski.io>
  • Loading branch information
austindrenski committed Jan 17, 2024
1 parent a6062fe commit 659a8d9
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions test/OpenFeature.Tests/OpenFeatureHookTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -553,5 +553,12 @@ public async Task When_Error_Occurs_In_After_Hook_Should_Invoke_Error_Hook()

await featureProvider.DidNotReceive().ResolveBooleanValue("test", false, Arg.Any<EvaluationContext>());
}

[Fact]
public void Add_hooks_should_accept_empty_enumerable()
{
Api.Instance.ClearHooks();
Api.Instance.AddHooks(Enumerable.Empty<Hook>());

Check failure on line 561 in test/OpenFeature.Tests/OpenFeatureHookTests.cs

View workflow job for this annotation

GitHub Actions / unit-tests-windows

OpenFeature.Tests.OpenFeatureHookTests.Add_hooks_should_accept_empty_enumerable

System.ArgumentOutOfRangeException : The startIndex argument must be greater than or equal to zero. (Parameter 'startIndex')

Check failure on line 561 in test/OpenFeature.Tests/OpenFeatureHookTests.cs

View workflow job for this annotation

GitHub Actions / unit-tests-linux

OpenFeature.Tests.OpenFeatureHookTests.Add_hooks_should_accept_empty_enumerable

System.ArgumentOutOfRangeException : The startIndex argument must be greater than or equal to zero. (Parameter 'startIndex')
}

Check failure on line 562 in test/OpenFeature.Tests/OpenFeatureHookTests.cs

View workflow job for this annotation

GitHub Actions / unit-tests-windows

OpenFeature.Tests.OpenFeatureHookTests.Add_hooks_should_accept_empty_enumerable

System.ArgumentOutOfRangeException : The startIndex argument must be greater than or equal to zero. Parameter name: startIndex
}
}

0 comments on commit 659a8d9

Please sign in to comment.