Unit Testing with NUnit

Microsoft .NET Framework, ASP.NET, Visual C# (CSharp, C Sharp, C-Sharp) Developer Training, Visual Studio


Jump to: navigation, search
CSharp-Online.NET:Articles
Visual Studio Articles

Unit Testing with NUnit

© 2004 O'Reilly & Assoc., Inc.
This article—Unit Testing with NUnit—is from NUnit Pocket Reference, by Bill Hamilton. Copyright © 2004 O'Reilly & Associates. All rights reserved. Reproduced by permission. This article has been edited especially for C# Online.NET.


Unit Testing with NUnit

This section discusses the different elements of the NUnit framework and how to use them to create unit tests and test structures. Figure 2 shows the relationship between the NUnit elements.

Image:NUPRfig-2.jpg
Figure 2. NUnit test elements

In the simplest case, NUnit requires only test cases and one or more test fixtures. Each test must contain at least one assertion. A description of these elements follows.


Previous_Page_.gif Next_Page_.gif


Personal tools