Skip to content

Commit

Permalink
Adding missing tests.
Browse files Browse the repository at this point in the history
Signed-off-by: André Silva <2493377+askpt@users.noreply.github.com>
  • Loading branch information
askpt committed Dec 20, 2024
1 parent 4146f0e commit 64f5c68
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions test/OpenFeature.Tests/OpenFeatureTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -299,5 +299,20 @@ public void SetTransactionContext_ShouldSetTransactionContext_WhenValidEvaluatio
mockPropagator.Received().SetTransactionContext(evaluationContext);
Assert.Equal(evaluationContext, result);
}

[Fact]
public void GetTransactionContext_ShouldReturnEmptyEvaluationContext_WhenNoPropagatorIsSet()
{
// Arrange
var api = Api.Instance;
var context = EvaluationContext.Builder().Set("status", "not-ready").Build();
api.SetTransactionContext(context);

// Act
var result = api.GetTransactionContext();

// Assert
Assert.Equal(EvaluationContext.Empty, result);
}
}
}

0 comments on commit 64f5c68

Please sign in to comment.