Author name: Daniel Ward

Using Moq to verify that an object or list was passed to a method

There is an NSubstitute counterpart to this post: How to easily match on object or list arguments with NSubstitute. Click there if you would like to see how to do this using NSubstitute. I recently had a use case where I wanted to use Moq’s It.Is to check if a model with certain properties was being …

Using Moq to verify that an object or list was passed to a method Read More »

How to unit test Serilog LogContext with TestCorrelator

I recently had a use case where I had added custom properties to the LogContext with Serilog, and I wanted to be able to test if those properties were being added as expected. As it turns out, this is actually quite easy, thanks to a library called TestCorrelator by Mitch Bodmer over at https://github.com/MitchBodmer/serilog-sinks-testcorrelator (which …

How to unit test Serilog LogContext with TestCorrelator Read More »

Scroll to Top