Since we have a system class that ties everything together, we can now write the first test.

Add a new Unit Test Project to your solution; name it SimpleMVVMTests.

Rename the pregenerated test method to InitTest() and put the following code in it:

Note: You will have to add a reference to the main project in the test project.
This creates a new object of our system class, initializes it and tests whether the initialization has made the main menu page the current page.

Run the test – it should be green.

We could (and should) also test whether our main menu button is hidden as it’s supposed to be:

Next step: SimpleMVVM, Part 5: The MainMenuPage view model