You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm not entirely sure yet on the way this should actually look.
As part of #22 I actually added some extension methods which add HaveErrorMessageWithException<T> as part of the test case.
I'm currently thinking along the lines of adding the following:
privatevoidGivenLogMessaageWithException(){varexception=newException("BANG BANG!");exception.Data.Add("some","property");_logger.Error(exception,"BANG!");}[Fact]publicvoidGivenLogMessageWithException_NewStyle(){GivenLogMessaageWithException();_inMemorySink.Should().HaveMessage("BANG!").Appearing().Once().WithException<Exception>()// Asserts that there is an exception and that the type matches the expectation.AndMessage("BANG BANG!");}[Fact]publicvoidGivenLogMessageWithException_NewStyleFullMatch(){GivenLogMessaageWithException();varexception=newException("BANG BANG!");exception.Data.Add("some","property");_inMemorySink.Should().HaveMessage("BANG!").Appearing().Once().WithException<Exception>().Matching(exception);// This is a shortcut for WithException<Exception>().Subject.Should().BeEquivalentTo(exception)}
suggestion:
The text was updated successfully, but these errors were encountered: