March 2018
Intermediate to advanced
192 pages
4h 4m
English
When unit testing ViewModels, it is best to break the tests into individual test classes that represent each ViewModel, resulting in a one-to-one relationship between ViewModel classes and the unit test classes that test their logic.
In order to test our ViewModels, we will need to add a reference to them within the unit tests project, as shown in the following screenshot:

We will start by creating a set of unit tests for DetailViewModel: