Unit Testing – C# – Part 02 – Project Structure

In the last blog I explained the class we are building and its business rules. In this blog I will show you how we setup the visual studio project before we begin writing our tests.

Source Code

You can find the source for this blog series here.

Visual Studio Project

The project is developed in Visual Studio 2017, .NET 4.7.1.

The solution is called TenPinBowlingScorer. The code is in the Scorer project which is a .NET framework library. I created a project for each unit testing framework. The examples in the blog will show NUnit. Just refer to the source code for the others.

Adding References for NUnit

The following Nuget packages were added to the NUnit project.

Adding References for XUnit

The following Nuget packages were added to the XUnit project.

The xunit package will also bring in a number of other dependencies.

Adding References for MSTest

The following Nuget packages were added to the MSTest project. Note: You can use the Unit Testing project template which will automatically bring in the Nuget packages however; make sure you do a Nuget update because the template includes older versions.

In the next blog we will start to build out the class.