Unit testing C# with MSTest and .NET Core Part 2 – Create the test project
1 min read

Unit testing C# with MSTest and .NET Core Part 2 – Create the test project

So now it’s time to create the test project and add to our solution file!

Create the new folder and step into it.

mkdir PrimeService.Tests
cd .\PrimeService.Tests\

Create the mstest project.

dotnet new mstest

Now add a reference to the Primeservice-project in the test-project.

dotnet add reference ..\PrimeService\PrimeService.csproj

Finally add the test-project to the unit testing solution.

dotnet sln add .\PrimeService.Tests\PrimeService.Tests.csproj

Awesome! All done. Now in the next post we’ll create our very first test!

Leave a Reply