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...
View ArticleAvoid ReSharper warning when doing multiple asserts
Since I started writing my NUnit asserts using Assert.That* instead of Assert.Are*, I’ve been hooked on the new syntax. The constraint API makes asserts readable and helps you specifying the expected...
View ArticleUsing AutoMoqCustomization with NUnit, Moq and AutoFixture
I’ve used mock as long as I remember (pretty much). I’m a big fan of the whole dependency injection movement and make heavily use of IoC containers. Especially constructor injection turns out to be the...
View ArticleEssential c# unit testing tools
During the last 6 years, I’ve preached unit testing to my colleagues and people attending my test-driven development courses. The set of tools I’ve used for this purpose have been stable, for the most...
View ArticleUsing 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)....
View Article