Game Development Reference
In-Depth Information
Using NUnit with a Project
NUnit is very simple to use, but before writing tests, a project is needed. In Visual
Studio, start a new project by selecting File > New Project as shown in Figure 4.20.
Once again, choose a Console Application project and call it PlayerTest.
This will create a default project with one file named Program.cs. Right-click on
the project and select Add > Class, as shown in Figure 4.20. This will be the player
class.
This brings up a dialog box with a number of preset class types from which to
choose, shown in Figure 4.21. The one needed here is simply a class, so choose
that and name it Player.cs. A separate class will also be needed for the tests; add
another class the same way, but call it TestPlayer.cs.
Figure 4.20
Adding a class in Visual Studio.
 
Search WWH ::




Custom Search