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()
{
string testData = “Hello World”;
Assert.AreEqual(“Hello World”, testData”, “The strings do not match!”);
}
}
Assert.AreSame()
This comparison method tests that same objects are referenced by both arguments.
The following are all the method signatures available for this method:
Assert.AreSame(object expected, object actual);
Assert.AreSame(object expected, object actual, string message);
Assert.AreSame(object expected, object actual, string message, object[] parameters);
The following code snippet shows how to use this comparison method:
[TestFixture]
public class SimpleClassTests
{
[Test]
public void TestSomething()
{
object object1 = this;
object object2 = this;
Assert.AreSame(object1, object2, “The objects do not match!”);
}
}
Assert.IsTrue()
This condition method tests that the condition parameter evaluates to true.
The following are all the method signatures available for this method:
Assert.IsTrue(bool condition);
Assert.IsTrue(bool condition, string message);
Assert.IsTrue(bool condition, string message, object[] parameters);
Search Nedrilad ::




Custom Search