In this section, we will add a test project using ASP.NET Core 2.0 and write unit tests using xUnit. Before we start writing tests, we should set up a test project in our existing application.
The following are a few simple steps needed for our test project setup:
- From Solution Explorer in Visual Studio, right-click on Solution 'Chap06_01' (1 project) and click on Add | New Project... , as shown in the following screenshot:
- From the Add New Project template, select .NET Core and xUnit Test Project (.NET Core) and provide a meaningful name, for example, Chap06_01_Test:
- Add folders named Fake and Services. (Refer to ...