I want to verify some logs logged. I am using the asp.net core built-in ILogger, and inject it with the asp.net core built-in DI:
private readonly ILogger<
I have to do a fair bit of logger verification for black box processes at work and, after putting up with the expressions for a short period, I caved and put together an expression builder - Moq.Contrib.ExpressionBuilders.Logging.
The end result is a shorter, fluent, verification statement:
logger.Verify(
Log.With.LogLevel(LogLevel.Error)
.And.EventId(666)
.And.LogMessage("I am a meat popsicle"),
Times.Once);