July 2017
Beginner
466 pages
9h 37m
English
Unit testing projects can also be created using .NET Core. In the command line, you can specify the template code mstest or xunit to create a simple unit test project or xUnit test project, respectively.
To create a simple unit test project from the command line, enter the following:
dotnet new mstest -n <ProjectName>
To create an xUnit test project, enter the following command:
dotnet new xunit -n <ProjectName>
You can also run a unit test project from the command line. You need to execute the dotnet test command to do so. The unit testing frameworks are bundled as a NuGet package and can be restored as ordinary dependencies. You can execute either of the following commands:
dotnet test
dotnet test <ProjectPath> ...Read now
Unlock full access