Zebra Game Kata Part 2 - Setup

I will use Visual C# 2010 Express which can be installed for free through the Web Platform Installer.

Launch Visual Studio 2010. I will be using Visual Studio 2010 Professional for the screenshots.

File -> New -> Project

Choose a class library, name the project "ZebraGame", and click Ok.

Delete the Class1.cs file.

Before we write a line of production code, we want to have a failing test to cover it. You can use MSTest out of the box if you have Visual Studio 2010 Professional or above. In this example, I will be using NUnit inside of a class library. This allows the Express Editions of Visual Studio to perform test driven development.

Right-Click on the Solution -> Add -> New Project

Add Class Library

Choose a class library again, name the project "ZebraGame.Test", and click Ok.

After the project is created, rename Class1.cs to ZebraProblemTest.cs. ZebraProblem is the name of the class we will be testing, and Test is just a suffix that I like to add to the end of tests.

Remove the unused usings by right-clicking on the using statements and choose Organize Usings -> Remove and Sort. Now add the [TestFixture] attribute to the top.

ZebraGame.Test/ZebraProblemTest.cs
namespace ZebraGame.Test
{
    [TestFixture]
    public class ZebraProblemTest
    {
    }
}

Adding the TestFixture attribute causes a compile-time error. To fix it, we need to bring in the NUnit package using NuGet. Right-click on the ZebraGame.Test project and choose:
Manage NuGet Packages…

Search online for NUnit. Install it. You should now have references to the NUnit framework.

Now you can add the using statement for the NUnit.Framework namespace. Just put your cursor over the TestFixture attribute and press CTRL+. (control + period). This will pull up the Generate from Usage menu. Choose the first option to add the using statement.

ZebraGame.Test/ZebraProblemTest.cs
using NUnit.Framework;
            
namespace ZebraGame.Test
{
    [TestFixture]
    public class ZebraProblemTest
    {
    }
}