Udostępnij za pośrednictwem


PexAssert Class

Definition

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 bool values are equal.

AreEqual(Boolean, Boolean, String)

Asserts that two bool values are equal.

AreEqual(Boolean, Boolean)

Asserts that two bool values are equal.

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

Asserts that two double values are equal within a specified precision, with a specified message in the exception object.

AreEqual(Double, Double, Double, String)

Asserts that two double values are equal within a specified precision, with a specified message in the exception object.

AreEqual(Double, Double, Double)

Asserts that two double values are equal within a specified precision.

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 float values are equal within a specified precision, with a specified message in the exception object.

AreEqual(Single, Single, Single, String)

Asserts that two float values are equal within a specified precision, with a specified message in the exception object.

AreEqual(Single, Single, Single)

Asserts that two float values are equal within a specified precision.

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 EqualityComparison delegate.

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 double values are not equal within a specified precision, with a specified message in the exception object.

AreNotEqual(Double, Double, Double, String)

Asserts that two double values are not equal within a specified precision, with a specified message in the exception object.

AreNotEqual(Double, Double, Double)

Asserts that two double values are not equal within a specified precision.

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 float values are not equal within a specified precision, with a specified message in the exception object.

AreNotEqual(Single, Single, Single, String)

Asserts that two float values are not equal within a specified precision, with a specified message in the exception object.

AreNotEqual(Single, Single, Single)

Asserts that two float values are not equal within a specified precision.

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 EqualityComparison delegate.

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 true, with a specified message in the exception object.

IsTrue(Boolean, String)

Asserts that the condition evaluates to true, with a specified message and format in the exception object.

IsTrue(Boolean)

Asserts that the condition evaluates to true.

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

Applies to

See also