I'm trying to test that my method sets context properties. For example, it does
LogContext.PushProperty(DiagnosticField.BoxId, "abcd");
....
Logger.Information("Message processed successfully");
then I'm trying to check if it was set properly, using this:
---- Expected message "Message processed successfully" to have a property "BoxId" but it wasn't found
Stack Trace:
----- Inner Stack Trace -----
XUnit2TestFramework.Throw(String message)
TestFrameworkProvider.Throw(String message)
DefaultAssertionStrategy.HandleFailure(String message)
AssertionScope.FailWith(Func`1 failReasonFunc)
AssertionScope.FailWith(Func`1 failReasonFunc)
AssertionScope.FailWith(String message, Object[] args)
LogEventAssertion.WithProperty(String name, String because, Object[] becauseArgs)
<>c__DisplayClass9_0.<PositiveProcessingTest>b__1() line 148
Testable.evaluate[a,b](FSharpFunc`2 body, a a)```
It looks like LogContext is not supported. Am I wrong? Please help. Thanks
I'm trying to test that my method sets context properties. For example, it does
LogContext.PushProperty(DiagnosticField.BoxId, "abcd");
....Logger.Information("Message processed successfully");
then I'm trying to check if it was set properly, using this:
I got the following error: