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
   csUnit.Assert

public abstract class Assert

Thread Safety

Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.

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

Assembly: csUnit (in csUnit.dll)

See Also

Assert Members | csUnit Namespace