Game Development Reference
In-Depth Information
The following code snippet shows how to use this comparison method:
[TestFixture]
public class SimpleClassTests
{
[Test]
public void TestSomething()
{
object anObject = null;
Assert.IsNull(anObject, “anObject is not null!”);
}
}
Assert.IsNotNull()
This condition method tests that the condition parameter does not evaluate to null .
The following are all the method signatures available for this method:
Assert.IsNotNull(object anObject);
Assert.IsNotNull(object anObject, string message);
Assert.IsNotNull(object anObject, string message, object[] parameters);
The following code snippet shows how to use this comparison method:
[TestFixture]
public class SimpleClassTests
{
[Test]
public void TestSomething()
{
object anObject = null;
Assert.IsNotNull(anObject, “anObject is null!”);
}
}
Assert.Fail()
This utility method allows you to generate test failure exceptions, often used when
performing project-specific assertions.
The following are all the method signatures available for this method:
Assert.Fail()
Assert.Fail(string message)
Assert.Fail(string message, object[] parameters)
Search Nedrilad ::




Custom Search