Game Development Reference
In-Depth Information
The following code snippet shows how to use this utility method:
[TestFixture]
public class SimpleClassTests
{
[Test]
public void TestSomething()
{
Assert.Fail(“I was explicitly thrown!”);
}
}
Assert.Ignore()
This utility methods allows you to ignore a particular test during runtime, but
should be used sparingly. A better approach is to use the [Category] attribute and
run the test groups applicable at the time.
The following are all the method signatures available for this method:
Assert.Ignore()
Assert.Ignore(string message)
Assert.Ignore(string message, object[] parameters)
The following code snippet shows how to use this utility method:
[TestFixture]
public class SimpleClassTests
{
[Test]
public void TestSomething()
{
Assert.Fail(“I was explicitly thrown!”);
}
}
A Simple Example
In order to perform testing, we obviously need a class to test against. Defined
below is a simple class we can use for unit testing. As described by its name, the
class is extremely simplistic, so I will just show the code for it and move right on
to the creation of a test fixture.
using System;
Search Nedrilad ::




Custom Search