csUnit Class Library

Assert Class

The Assert class is used in test methods to assert a known condition. For instance, after running some logic, to assert that a result variable has an expected value, use the

Assert.Equals
method.

For a list of all members of this type, see Assert Members.

System.Object
   Assert

public abstract class Assert

Example

[TestFixture] public class MyTest { public MyTest() { } [Test] public void FirstTest() { int result = RunSomeMethod(); // Make sure the result is 25 Assert.Equals(25, result, "The result should have been 25"); } }

Requirements

Namespace: csUnit Namespace

Assembly: csUnit.dll

See Also

Assert Members | csUnit Namespace