Home|Tag: TDD

Assert.Throws<> Over ExpectedException

Writing unit tests that expects a given type of exception under given circumstances is essential for any test suite. Although it is useful to use the correct assertion types when testing for exceptions. In this post I will provide some guidance on why to use Assert.Throws<>() instead of ExpectedException. Using the ExpectedException: In

Easy Property Notification Verification in MVVM

Currently I’m doing a lot of WPF, we’re profound users of the MVVM pattern. I therefore often find myself writing a lot of unit tests for viewmodels. A, or maybe the, key feature of the MVVM pattern is the property binding between the view and the viewmodel. Once assigned a value to a property, the viewmodel notifies