Skip to content

Commit 25af4ba

Browse files
committed
Adding specification test.
Signed-off-by: André Silva <[email protected]>
1 parent 5cedb62 commit 25af4ba

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

test/OpenFeature.Tests/OpenFeatureClientTests.cs

+20
Original file line numberDiff line numberDiff line change
@@ -656,5 +656,25 @@ public async Task TheClient_MergesTheEvaluationContextInTheCorrectOrder(string k
656656

657657
Assert.Equal(expectedResult, actualEvaluationContext.GetValue(key).AsString);
658658
}
659+
660+
[Fact]
661+
[Specification("4.3.8", "'evaluation details' passed to the 'finally' stage matches the evaluation details returned to the application author")]
662+
public async Task FinallyHook_IncludesEvaluationDetails()
663+
{
664+
// Arrange
665+
var provider = new TestProvider();
666+
var providerHook = Substitute.For<Hook>();
667+
provider.AddHook(providerHook);
668+
await Api.Instance.SetProviderAsync(provider);
669+
var client = Api.Instance.GetClient();
670+
671+
const string flagName = "flagName";
672+
673+
// Act
674+
var evaluationDetails = await client.GetBooleanDetailsAsync(flagName, true);
675+
676+
// Assert
677+
await providerHook.Received(1).FinallyAsync(Arg.Any<HookContext<bool>>(), evaluationDetails);
678+
}
659679
}
660680
}

0 commit comments

Comments
 (0)