PexAssert Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
A static helper class that contains a set of methods to express assertions in parameterized unit tests.
public ref class PexAssert abstract sealed
[__Instrument]
public static class PexAssert
[<__Instrument>]
type PexAssert = class
Public Class PexAssert
- Inheritance
-
PexAssert
- Attributes
-
__InstrumentAttribute
Remarks
PexAssert is similar in behavior to Assert
. The methods make various statements about the code under test. If the statement is false, the method throws PexAssertFailedException. Any message in the exception object is displayed in IntelliTest Exploration window.
Methods
AreEqual(Boolean, Boolean, String, Object[]) |
Asserts that two |
AreEqual(Boolean, Boolean, String) |
Asserts that two |
AreEqual(Boolean, Boolean) |
Asserts that two |
AreEqual(Double, Double, Double, String, Object[]) |
Asserts that two |
AreEqual(Double, Double, Double, String) |
Asserts that two |
AreEqual(Double, Double, Double) |
Asserts that two |
AreEqual(Object, Object, String, Object[]) |
Asserts that two object instances are equal, with a specified message in the exception object. |
AreEqual(Object, Object, String) |
Asserts that two object instances are equal, with a specified message in the exception object. |
AreEqual(Object, Object) |
Asserts that two object instances are equal. |
AreEqual(Single, Single, Single, String, Object[]) |
Asserts that two |
AreEqual(Single, Single, Single, String) |
Asserts that two |
AreEqual(Single, Single, Single) |
Asserts that two |
AreEqual(String, String, Boolean, CultureInfo, String, Object[]) |
Asserts that a culture-specific comparison of two strings is true, with a specified message in the exception object. |
AreEqual(String, String, Boolean, CultureInfo, String) |
Asserts that a culture-specific comparison of two strings is true, with a specified message in the exception object. |
AreEqual(String, String, Boolean, CultureInfo) |
Asserts that a culture-specific comparison of two strings is true. |
AreEqual(String, String, Boolean, String, Object[]) |
Asserts that two strings are equal with a specified message in the exception object. |
AreEqual(String, String, Boolean, String) |
Asserts that two strings are equal with a specified message in the exception object. |
AreEqual(String, String, Boolean) |
Asserts that two strings are equal, using the Ordinal comparer. |
AreEqual<T>(T, T, PexEqualityComparison<T>) |
Asserts that two object instances with a specified type are equal,
based on an |
AreEqual<T>(T, T, String, Object[]) |
Asserts that two object instances with a specified type are equal, with a specified message in the exception object. |
AreEqual<T>(T, T, String) |
Asserts that two object instances with a specified type are equal, with a specified message in the exception object. |
AreEqual<T>(T, T) |
Asserts that two object instances with a specified type are equal. |
AreNotEqual(Double, Double, Double, String, Object[]) |
Asserts that two |
AreNotEqual(Double, Double, Double, String) |
Asserts that two |
AreNotEqual(Double, Double, Double) |
Asserts that two |
AreNotEqual(Object, Object, String, Object[]) |
Asserts that two object instances are not equal, with a specified message in the exception object. |
AreNotEqual(Object, Object, String) |
Asserts that two object instances are not equal, with a specified message in the exception object. |
AreNotEqual(Object, Object) |
Asserts that two object instances are not equal. |
AreNotEqual(Single, Single, Single, String, Object[]) |
Asserts that two |
AreNotEqual(Single, Single, Single, String) |
Asserts that two |
AreNotEqual(Single, Single, Single) |
Asserts that two |
AreNotEqual(String, String, Boolean, CultureInfo, String, Object[]) |
Asserts that a culture-specific comparison of two strings is false, with a specified message in the exception object. |
AreNotEqual(String, String, Boolean, CultureInfo, String) |
Asserts that a culture-specific comparison of two strings is false, with a specified message in the exception object. |
AreNotEqual(String, String, Boolean, CultureInfo) |
Asserts that a culture-specific comparison of two strings is false. |
AreNotEqual(String, String, Boolean, String, Object[]) |
Asserts that two strings are not equal, with a specified message in the exception object. |
AreNotEqual(String, String, Boolean, String) |
Asserts that two strings are not equal, with a specified message in the exception object. |
AreNotEqual(String, String, Boolean) |
Asserts that two strings are not equal. |
AreNotEqual<T>(T, T, PexEqualityComparison<T>) |
Asserts that two object instances with a specified type are not equal,
based on an |
AreNotEqual<T>(T, T, String, Object[]) |
Asserts that two object instances with a specified type are not equal, with a specified message in the exception object. |
AreNotEqual<T>(T, T, String) |
Asserts that two object instances with a specified type are not equal, with a specified message in the exception object. |
AreNotEqual<T>(T, T) |
Asserts that two object instances with a specified type are not equal. |
ClearReached() |
Clears the Reached event |
CreateException() |
Creates the assumption/assertion exception instance |
Fail() |
Asserts Fail unconditionally. Test will throw a PexAssertFailedException. |
Fail(Exception, String) |
Asserts unconditionally. |
Fail(String, Object[]) |
Asserts unconditionally, with a specified message and formatting for the exception object. |
Fail(String) |
Asserts unconditionally, with a specified message in the exception object. |
IsNotNull(Object, String, Object[]) |
Asserts that the object reference is not null with a specified message in the exception object. |
IsNotNull(Object, String) |
Asserts that the object reference is not null with a specified message in the exception object. |
IsNotNull(Object) |
Asserts that the object reference is not null. |
IsNull(Object, String, Object[]) |
Asserts that the object reference is null with a specified message in the exception object. if the object reference is not null. |
IsNull(Object, String) |
Asserts that the object reference is null with a specified message in the exception object. |
IsNull(Object) |
Asserts that the object reference is null. |
IsTrue(Boolean, String, Object[]) |
Asserts that the condition evaluates to |
IsTrue(Boolean, String) |
Asserts that the condition evaluates to |
IsTrue(Boolean) |
Asserts that the condition evaluates to |
ReachEventually() |
Specifies that the default location in the program should be reached eventually. |
ReachEventually(Int32) |
Specifies a location in the program that should be reached eventually. |
ReachEventually(String) |
Specifies a location in the program that should be reached eventually. |
Events
Reached |
Raised when the Reached method is invoked |