Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

PexAssert Class

 

Static class to express assertions, i.e. a postcondition, in parameterized unit tests.

If the asserted condition does not hold for some test input, a PexAssertFailedException is thrown, which will cause the test to fail.

Namespace:   Microsoft.Pex.Framework
Assembly:  Microsoft.Pex.Framework (in Microsoft.Pex.Framework.dll)

System.Object
  Microsoft.Pex.Framework.PexAssert

[__InstrumentAttribute]
public static class PexAssert

NameDescription
System_CAPS_pubmethodSystem_CAPS_staticAreEqual(Boolean, Boolean)

System_CAPS_pubmethodSystem_CAPS_staticAreEqual(Boolean, Boolean, String)

System_CAPS_pubmethodSystem_CAPS_staticAreEqual(Boolean, Boolean, String, Object[])

System_CAPS_pubmethodSystem_CAPS_staticAreEqual(Double, Double, Double)

System_CAPS_pubmethodSystem_CAPS_staticAreEqual(Double, Double, Double, String)

System_CAPS_pubmethodSystem_CAPS_staticAreEqual(Double, Double, Double, String, Object[])

System_CAPS_pubmethodSystem_CAPS_staticAreEqual(Object, Object)

System_CAPS_pubmethodSystem_CAPS_staticAreEqual(Object, Object, String)

System_CAPS_pubmethodSystem_CAPS_staticAreEqual(Object, Object, String, Object[])

System_CAPS_pubmethodSystem_CAPS_staticAreEqual(Single, Single, Single)

System_CAPS_pubmethodSystem_CAPS_staticAreEqual(Single, Single, Single, String)

System_CAPS_pubmethodSystem_CAPS_staticAreEqual(Single, Single, Single, String, Object[])

System_CAPS_pubmethodSystem_CAPS_staticAreEqual(String, String, Boolean)

System_CAPS_pubmethodSystem_CAPS_staticAreEqual(String, String, Boolean, CultureInfo)

System_CAPS_pubmethodSystem_CAPS_staticAreEqual(String, String, Boolean, CultureInfo, String)

System_CAPS_pubmethodSystem_CAPS_staticAreEqual(String, String, Boolean, CultureInfo, String, Object[])

System_CAPS_pubmethodSystem_CAPS_staticAreEqual(String, String, Boolean, String)

System_CAPS_pubmethodSystem_CAPS_staticAreEqual(String, String, Boolean, String, Object[])

System_CAPS_pubmethodSystem_CAPS_staticAreEqual<T>(T, T)

System_CAPS_pubmethodSystem_CAPS_staticAreEqual<T>(T, T, PexEqualityComparison<T>)

System_CAPS_pubmethodSystem_CAPS_staticAreEqual<T>(T, T, String)

System_CAPS_pubmethodSystem_CAPS_staticAreEqual<T>(T, T, String, Object[])

System_CAPS_pubmethodSystem_CAPS_staticAreNotEqual(Double, Double, Double)

System_CAPS_pubmethodSystem_CAPS_staticAreNotEqual(Double, Double, Double, String)

System_CAPS_pubmethodSystem_CAPS_staticAreNotEqual(Double, Double, Double, String, Object[])

System_CAPS_pubmethodSystem_CAPS_staticAreNotEqual(Object, Object)

System_CAPS_pubmethodSystem_CAPS_staticAreNotEqual(Object, Object, String)

System_CAPS_pubmethodSystem_CAPS_staticAreNotEqual(Object, Object, String, Object[])

System_CAPS_pubmethodSystem_CAPS_staticAreNotEqual(Single, Single, Single)

System_CAPS_pubmethodSystem_CAPS_staticAreNotEqual(Single, Single, Single, String)

System_CAPS_pubmethodSystem_CAPS_staticAreNotEqual(Single, Single, Single, String, Object[])

System_CAPS_pubmethodSystem_CAPS_staticAreNotEqual(String, String, Boolean)

System_CAPS_pubmethodSystem_CAPS_staticAreNotEqual(String, String, Boolean, CultureInfo)

System_CAPS_pubmethodSystem_CAPS_staticAreNotEqual(String, String, Boolean, CultureInfo, String)

System_CAPS_pubmethodSystem_CAPS_staticAreNotEqual(String, String, Boolean, CultureInfo, String, Object[])

System_CAPS_pubmethodSystem_CAPS_staticAreNotEqual(String, String, Boolean, String)

System_CAPS_pubmethodSystem_CAPS_staticAreNotEqual(String, String, Boolean, String, Object[])

System_CAPS_pubmethodSystem_CAPS_staticAreNotEqual<T>(T, T)

System_CAPS_pubmethodSystem_CAPS_staticAreNotEqual<T>(T, T, PexEqualityComparison<T>)

System_CAPS_pubmethodSystem_CAPS_staticAreNotEqual<T>(T, T, String)

System_CAPS_pubmethodSystem_CAPS_staticAreNotEqual<T>(T, T, String, Object[])

System_CAPS_pubmethodSystem_CAPS_staticClearReached()

System_CAPS_pubmethodSystem_CAPS_staticCreateException()

System_CAPS_pubmethodSystem_CAPS_staticFail()

System_CAPS_pubmethodSystem_CAPS_staticFail(Exception, String)

System_CAPS_pubmethodSystem_CAPS_staticFail(String)

System_CAPS_pubmethodSystem_CAPS_staticFail(String, Object[])

System_CAPS_pubmethodSystem_CAPS_staticIsNotNull(Object)

System_CAPS_pubmethodSystem_CAPS_staticIsNotNull(Object, String)

System_CAPS_pubmethodSystem_CAPS_staticIsNotNull(Object, String, Object[])

System_CAPS_pubmethodSystem_CAPS_staticIsNull(Object)

System_CAPS_pubmethodSystem_CAPS_staticIsNull(Object, String)

System_CAPS_pubmethodSystem_CAPS_staticIsNull(Object, String, Object[])

System_CAPS_pubmethodSystem_CAPS_staticIsTrue(Boolean)

System_CAPS_pubmethodSystem_CAPS_staticIsTrue(Boolean, String)

System_CAPS_pubmethodSystem_CAPS_staticIsTrue(Boolean, String, Object[])

System_CAPS_pubmethodSystem_CAPS_staticReachEventually()

System_CAPS_pubmethodSystem_CAPS_staticReachEventually(Int32)

System_CAPS_pubmethodSystem_CAPS_staticReachEventually(String)

NameDescription
System_CAPS_pubeventSystem_CAPS_staticReached

Asserts that the absolute value of an integer is positive:

public void Test(int i) {
     int j = Math.Abs(i);
     PexAssert.IsTrue(j >= 0);
}

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

PexAssume
T:Microsoft.Pex.Framework. PexObserve
T:Microsoft.Pex.Framework. PexChoose
Microsoft.Pex.Framework Namespace

Return to top
Show: