ASP.NET Core unit tests
In this section, we'll learn how to build an ASP.NET Core unit test project using xUnit.net, a free, open-source, community-focused unit testing tool for .NET created by Brad Wilson, who also developed NUnit v2. We've chosen this tool because it's arguably one of the most powerful and easy-to-use unit testing tools available today. It's part of the .NET Foundation, hence operating under their code of conduct, and is licensed under the Apache License, version 2.
Before moving on, we'll also take the opportunity to talk about TDD and BDD in the following sections. These are two widely used testing approaches that have a number of similarities and differences that are worth exploring.
Creating the WorldCities.Test project
The first thing to do is to add a second project to our WorldCities
solution.
The best way to handle this is to have the WorldCities.sln
solution file in a dedicated solution folder:
/Projects/WorldCities...