Game Development Reference
In-Depth Information
The following code snippet shows how to use this attribute:
[TestFixture]
public class SimpleClassTests
{
[SetUp]
public void SetUp()
{
// Do some initialization for the tests
}
}
Note
It is important that a [SetUp] method be marked public, return void, and not take in any parame-
ters.
[TearDown]
A method in a [TestFixture] marked with the [TearDown] attribute will be executed
immediately after each test is run.
The following code snippet shows how to use this attribute:
[TestFixture]
public class SimpleClassTests
{
[TearDown]
public void TearDown()
{
// Do some cleanup for the tests
}
}
Note
It is important that a [TearDown] method be marked public, return void, and not take in any para-
meters.
[Ignore]
There may be times when you want to temporarily disable a test or test fixture
from being run, and without commenting out the code for it so that you are still
reminded of the exemption within NUnit. Any method or class marked with either
the [Test] or [TestFixture] attribute can be marked with the [Ignore] attribute.
 
Search Nedrilad ::




Custom Search