Other NUnit Capabilities

With our previous example, we introduced the basic NUnit features and capabilities. TestFixture, Test, and Assert are the three most fundamental features that you need to know to start writing programmer tests with NUnit. What we will describe now will build on these three features.

Using SetUp/TearDown Attributes

In the definition of a test fixture that we gave earlier, we said that tests in a test fixture share a common set of run-time resources. These common run-time resources may need to be acquired and initialized in a certain way before a test is executed and released or cleaned up after the test is completed. NUnit supports this common initialization/cleanup process using two additional custom attributes: SetUp and ...

Get Test-Driven Development in Microsoft® .NET now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.