Closed brandonh-msft closed 1 year ago
Ah, found VerifyNoOtherCalls
just now. So I suppose the way to accomplish what I want is to run the successful path, assert any Information, Trace, Debug lines I know will come through, then throw this API after those. 👍🏻
Actually, no, I think I would like something like this - otherwise I am forced to constantly add any new non-X lines to my UT just to ensure no X lines were logged.
Maybe I didn't understand well the issue, but isn't the Moq way of using the right approach?
loggerMock.VerifyLog(logger => logger.LogError("Some error"), Times.Never);
Thanks - been a while since I've used Moq and it's changed a lot but this appears to be what I'm after!
Np, thank you too, that was the goal of this library, to re-use Moq's features and not to re-create a simple wrapper over Moq.
Looking to try and assert that a specific type/message was not logged - any capability for this?
e.g. if I run a method and expect everything to succeed, I want to ensure no LogWarning or LogErrors were sent during that execution.