Running our tests
The .NET CLI provides a command for this purpose:
dotnet test
This command will compile the code and the test project, discover the test classes and test methods, execute the tests, and return the results.
Visual Studio Code also provides a graphical user interface (GUI) for listing and executing the tests. This pane can be displayed by clicking on the appropriate icon, as shown in the following figure:

Figure 10.7 – Running tests
This GUI also provides a visual identification of the states of the test methods. In the preceding screenshot, we can see that our test method has been completed successfully.
From this GUI, we can also debug tests! This is a fantastic capability that helps us understand why a test is failing by strategically applying breakpoints and re-executing it in debug mode.
Excellent! We can implement more tests.
But wait!
Have you noticed that we passed a null
instance of the BookmarkrService...