Setting up a unit test project
In this section, we will be walking through the steps of setting up a unit test project and creating a first test. We’ll be using xUnit in this section. We’re not going to get all tangled up in the tiny details of this specific library because there are tons of other awesome ones. No matter what you choose, the big takeaways should stick with you. So, without further ado, let’s dive in and start setting the stage for effective ViewModel testing!
Creating a unit test project
Let’s start by creating an xUnit Test project. In xUnit, one of the things I appreciate is its simplicity. Test classes and methods are just normal classes and methods, without the need for special base classes or complex setups. Here’s how:
- In the Solution Explorer in Visual Studio, right-click Solution ‘Recipes App’ and select Add | New Project….
- In the Add a new project dialog, type
xunit
in the search box...