Using Moq callbacks as Verify

One thing using Moq always bugged me. When needing to verify some method call, Moq provides a Verify-metod on the Mock object: So, what’s wrong with this piece of code? In fact nothing (if you ask me). The “problem” is the error message if the test fails: Something fails!…

Asserting using Shouldly

I’ve been praising the “new” Assert.That syntax, since introduced in NUnit 2.4. Expressing your tests using a constraint based API, rather than the old Are* and Is* API, makes reading your tests piece of pie. Take a look at the following test sample: var result = "Hello…