diff --git a/test/OpenFeature.Tests/AsyncLocalTransactionContextPropagatorTests.cs b/test/OpenFeature.Tests/AsyncLocalTransactionContextPropagatorTests.cs index ae44aa4b..51c94bfb 100644 --- a/test/OpenFeature.Tests/AsyncLocalTransactionContextPropagatorTests.cs +++ b/test/OpenFeature.Tests/AsyncLocalTransactionContextPropagatorTests.cs @@ -23,7 +23,9 @@ public void SetTransactionContext_SetsAndGetsContextCorrectly() { // Arrange var propagator = new AsyncLocalTransactionContextPropagator(); - var evaluationContext = EvaluationContext.Empty; + var evaluationContext = EvaluationContext.Builder() + .Set("initial", "yes") + .Build(); // Act propagator.SetTransactionContext(evaluationContext); @@ -31,6 +33,7 @@ public void SetTransactionContext_SetsAndGetsContextCorrectly() // Assert Assert.Equal(evaluationContext, context); + Assert.Equal(evaluationContext.GetValue("initial"), context.GetValue("initial")); } [Fact] diff --git a/test/OpenFeature.Tests/OpenFeatureTests.cs b/test/OpenFeature.Tests/OpenFeatureTests.cs index b2c6d9de..1955f82d 100644 --- a/test/OpenFeature.Tests/OpenFeatureTests.cs +++ b/test/OpenFeature.Tests/OpenFeatureTests.cs @@ -285,7 +285,9 @@ public void SetTransactionContext_ShouldSetTransactionContext_WhenValidEvaluatio { // Arrange var api = Api.Instance; - var evaluationContext = EvaluationContext.Empty; + var evaluationContext = EvaluationContext.Builder() + .Set("initial", "yes") + .Build(); var mockPropagator = Substitute.For(); mockPropagator.GetTransactionContext().Returns(evaluationContext); api.SetTransactionContextPropagator(mockPropagator); @@ -298,6 +300,7 @@ public void SetTransactionContext_ShouldSetTransactionContext_WhenValidEvaluatio // Assert mockPropagator.Received().SetTransactionContext(evaluationContext); Assert.Equal(evaluationContext, result); + Assert.Equal(evaluationContext.GetValue("initial"), result.GetValue("initial")); } [Fact]