Udostępnij za pośrednictwem


PexAssume Class

Definition

A static helper class that contains a set of methods to express preconditions in parameterized unit tests.

public ref class PexAssume abstract sealed
[__Instrument]
public static class PexAssume
[<__Instrument>]
type PexAssume = class
Public Class PexAssume
Inheritance
PexAssume
Attributes
__InstrumentAttribute

Remarks

The PexAssume methods can be used to filter out undesirable test inputs. If the specified condition does not hold for a test input, IntelliTest throws PexAssumeFailedException and silently ignores the test.

Methods

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

Assumes that two bool values are equal.

AreEqual(Boolean, Boolean, String)

Assumes that two bool values are equal.

AreEqual(Boolean, Boolean)

Assumes that two bool values are equal.

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

The test case fails if two double values are not equal within a specified precision, with a specified message in the exception object.

AreEqual(Double, Double, Double, String)

The test case fails if two double values are not equal within a specified precision, with a specified message in the exception object.

AreEqual(Double, Double, Double)

The test case fails if two double values are not equal within a specified precision.

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

The test fails if two object instances are not equal, with a specified message in the exception object.

AreEqual(Object, Object, String)

The test fails if two object instances are not equal, with a specified message in the exception object.

AreEqual(Object, Object)

The test fails if two object instances are not equal.

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

The test case fails if two float values are not equal within a specified precision, with a specified message in the exception object.

AreEqual(Single, Single, Single, String)

The test case fails if two float values are not equal within a specified precision, with a specified message in the exception object.

AreEqual(Single, Single, Single)

The test case fails if two float values are not equal within a specified precision.

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

The test fails if a culture-specific comparison of two strings is false, with a specified message in the exception object.

AreEqual(String, String, Boolean, CultureInfo, String)

The test fails if a culture-specific comparison of two strings is false, with a specified message in the exception object.

AreEqual(String, String, Boolean, CultureInfo)

The test fails if a culture-specific comparison of two strings is false.

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

The test case fails if two strings are not equal, with a specified message in the exception object.

AreEqual(String, String, Boolean, String)

The test case fails if two strings are not equal, with a specified message in the exception object.

AreEqual(String, String, Boolean)

The test case fails if two strings are not equal.

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

The test fails if two object instances of a specified type are not equal, with a specified message in the exception object.

AreEqual<T>(T, T, String)

The test fails if two object instances of a specified type are not equal, with a specified message in the exception object.

AreEqual<T>(T, T)

The test fails if two object instances of a specified type are not equal.

BooleanIsZeroOrOne(Boolean)

Assumes that a boolean value is either zero or one

CreateException()

Creates the assumption/assertion exception instance

EnumIsDefined<TEnum>(TEnum)

The test fails if the value is not defined in the specified enumeration.

Fail()

The test case failes unconditionally.

Fail(String, Object[])

The test case failes unconditionally, with a specified message in the exception object.

Fail(String)

The test case failes unconditionally, with a specified message in the exception object.

IsNotNull(Object, String, Object[])

The test case fails if the value is a null reference, with a specified message in the exception object.

IsNotNull(Object, String)

The test case fails if the value is a null reference, with a specified message in the exception object.

IsNotNull(Object)

The test case fails if the value is a null reference.

IsNotNullOrEmpty(String)

The test fails if a specified string is null or empty.

IsNull(Object, String, Object[])

The test case fails if the value is not a null reference, with a specified message in the exception object.

IsNull(Object, String)

The test case fails if the value is not a null reference, with a specified message in the exception object.

IsNull(Object)

The test case fails if the value is not a null reference.

IsNullOrEmpty(String)

The test fails if a specified string is not null or empty.

IsTrue(Boolean, String, Object[])

The test case fails if the condition evaluates to false, with a specified message in the exception object.

IsTrue(Boolean, String)

The test case fails if the condition evaluates to false, with a specified message in the exception object.

IsTrue(Boolean)

The test case fails if the condition evaluates to false.

IsTrue<T>(Boolean, PexAssume.Func<T>)

The test case fails if the condition evaluates to false, otherwise it runs the factory delegate and returns the result.

Applies to