.NET

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

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: