This section covers some common testing practices used to test .NET Core applications. More specifically, it focuses on testing the repository part of the application. First of all, let's create a new test project by executing the following commands in the root folder of the project (the same folder as the .sln file):
mkdir tests
cd tests
dotnet new xunit -n Catalog.Infrastructure.Tests
dotnet sln ../Catalog.API.sln add Catalog.Infrastructure.Tests
As a result, we have created a new tests directory, which will contain all the test projects of the service. We also created a new Catalog.Infrastructure.Tests project using the xunit template.
xunit is a very popular test framework in the .NET ecosystem, and it is the default choice for testing in .NET Core framework templates. Because we created our project using the xunit template, the Catalog.Infrastructure...