Unit testing using NUnit sample
This sample is part of the unit testing tutorial for creating applications with unit tests included. See that topic for detailed steps on the code for this sample.
This sample demonstrates creating a library and writing effective unit tests that validate the features in that library. The example provides a service that indicates whether a number is prime.
Restore and test
To run the tests, navigate to the PrimeService.Tests directory and type the following commands:
dotnet restore dotnet test
dotnet restore restores the packages of both projects.
dotnet test builds both projects and runs all of the configured tests.
[!INCLUDEDotNet Restore Note]