Adding a test project to Bookmarkr
In order to add a test project for our CLI application, I needed to make a slight change to the project structure, which was to extract the solution file (.sln
) from the project directory and edit it to update the path to the .csproj
file. This allows us to create a test project and add it to the solution.
Next, let’s type the following command to create the test project:
dotnet new mstest -n bookmarkr.UnitTests
This will create a new directory, named bookmarkr.UnitTests
, in which the content of the test project will reside.
Right now, this directory only contains two files:
Bookmarkr.UnitTests.csproj
, which describes the project, its configuration, and its dependenciesUnitTest1.cs
, which acts as a sample test class
It is interesting to note that the .csproj
file already references some testing libraries and frameworks, particularly the MS Test testing framework, which is the one we will be using throughout this...