Skip to content

Commit 5ca4dc8

Browse files
committed
Fail on purpose
1 parent 8804a1b commit 5ca4dc8

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

tests/Moq.ILogger.Tests/VerifyLogExtensionsTests.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -950,6 +950,15 @@ public void Verify_log_error_with_an_expected_event_id_and_message_it_fails_with
950950
.WithMessage("*an error must be logged*")
951951
.WithMessage("*Expected invocation on the mock once, but was 0 times*");
952952
}
953+
954+
[Fact]
955+
public void Verify_log_error_with_an_expected_event_id_and_message_it_fails_with_expected_message_fail_on_purpose()
956+
{
957+
var loggerMock = new Mock<ILogger<object>>();
958+
loggerMock.Object.LogError(50100, "the description of the error goes here");
959+
960+
loggerMock.VerifyLog(logger => logger.LogError(50200, "the description of the error goes here"), Times.Once(), "an error must be logged");
961+
}
953962
}
954963

955964
internal static class OtherExtensions

0 commit comments

Comments
 (0)