

For macOS and Unix, update the ren command to the OS version of ren to rename a file: dotnet new sln -o unit-testing-using-dotnet-test The following commands create the test solution on a windows machine. Skip this section if you've completed the steps in the previous section.

This section summarizes all the commands in the previous section. PrimeService.Tests/Īdd the PrimeService class library as a dependency to the PrimeService.Tests project: dotnet add. Configures the test runner by adding the following elements to the project file:Īdd the test project to the solution file by running the following command: dotnet sln add.The test project uses xUnit as the test library. Creates the PrimeService.Tests project in the PrimeService.Tests directory.PrimeService/PrimeService.csprojĬreate the PrimeService.Tests project by running the following command: dotnet new xunit -o PrimeService.Tests In the unit-testing-using-dotnet-test directory, run the following command to add the class library project to the solution: dotnet sln add.

Throws a NotImplementedException with a message indicating it's not implemented.Throw new NotImplementedException("Not implemented.") Replace the code in PrimeService.cs with the following code: using System The new class library will contain the code to be tested. The dotnet new classlib command creates a new class library project in the PrimeService folder. Run the following command: dotnet new classlib -o PrimeService The dotnet new sln command creates a new solution in the unit-testing-using-dotnet-test directory.Ĭhange directory to the unit-testing-using-dotnet-test folder. Run the following command: dotnet new sln -o unit-testing-using-dotnet-test See Commands to create test solution for instructions to create the test solution in one step. The following instructions provide the steps to create the test solution. The completed solution has the following directory structure: /unit-testing-using-dotnet-test In this section, a solution is created that contains the source and test projects. For download instructions, see Samples and Tutorials. To follow the tutorial using a pre-built solution, view or download the sample code.
WHITEBOX LEARNING UNITY WEB PLAYER HOW TO
This tutorial shows how to build a solution containing a unit test project and source code project.
