NUnit.Framework.Constraints Namespace

Classes

AllItemsConstraint

AllItemsConstraint applies another constraint to each item in a collection, succeeding if they all succeed.

AllOperator

Represents a constraint that succeeds if all the members of a collection match a base constraint.

AndConstraint

AndConstraint succeeds only if both members succeed.

AndOperator

Operator that requires both it's arguments to succeed

AssignableFromConstraint

AssignableFromConstraint is used to test that an object can be assigned from a given Type.

AssignableToConstraint

AssignableToConstraint is used to test that an object can be assigned to a given Type.

AttributeConstraint

AttributeConstraint tests that a specified attribute is present on a Type or other provider and that the value of the attribute satisfies some other constraint.

AttributeExistsConstraint

AttributeExistsConstraint tests for the presence of a specified attribute on a Type.

AttributeOperator

Operator that tests for the presence of a particular attribute on a type and optionally applies further tests to the attribute.

BasicConstraint

BasicConstraint is the abstract base for constraints that perform a simple comparison to a constant value.

BinaryConstraint

BinaryConstraint is the abstract base of all constraints that combine two other constraints in some fashion.

BinaryOperator

Abstract base class for all binary operators

BinarySerializableConstraint

BinarySerializableConstraint tests whether an object is serializable in binary format.

CollectionConstraint

CollectionConstraint is the abstract base class for constraints that operate on collections.

CollectionContainsConstraint

CollectionContainsConstraint is used to test whether a collection contains an expected object as a member.

CollectionEquivalentConstraint

CollectionEquivalentCOnstraint is used to determine whether two collections are equivalent.

CollectionItemsEqualConstraint

CollectionItemsEqualConstraint is the abstract base class for all collection constraints that apply some notion of item equality as a part of their operation.

CollectionOperator

Abstract base for operators that indicate how to apply a constraint to items in a collection.

CollectionOrderedConstraint

CollectionOrderedConstraint is used to test whether a collection is ordered.

CollectionSubsetConstraint

CollectionSubsetConstraint is used to determine whether one collection is a subset of another

CollectionTally
ComparisonAdapter

ComparisonAdapter class centralizes all comparisons of values in NUnit, adapting to the use of any provided IComparer, IComparer<T> or Comparison<T>

ComparisonConstraint

Abstract base class for constraints that compare values to determine if one is greater than, equal to or less than the other.

Constraint

The Constraint class is the base of all built-in constraints within NUnit. It provides the operator overloads used to combine constraints.

ConstraintBuilder

ConstraintBuilder maintains the stacks that are used in processing a ConstraintExpression. An OperatorStack is used to hold operators that are waiting for their operands to be reognized. a ConstraintStack holds input constraints as well as the results of each operator applied.

ConstraintBuilder.ConstraintStack

ConstraintStack is a type-safe stack for holding Constraints

ConstraintBuilder.OperatorStack

OperatorStack is a type-safe stack for holding ConstraintOperators

ConstraintExpression

ConstraintExpression represents a compound constraint in the process of being constructed from a series of syntactic elements. Individual elements are appended to the expression as they are reognized. Once an actual Constraint is appended, the expression returns a resolvable Constraint.

ConstraintExpressionBase

ConstraintExpressionBase is the abstract base class for the generated ConstraintExpression class, which represents a compound constraint in the process of being constructed from a series of syntactic elements. NOTE: ConstraintExpressionBase is aware of some of its derived classes, which is an apparent violation of encapsulation. Ideally, these classes would be a single class, but they must be separated in order to allow parts to be generated under .NET 1.x and to provide proper user feedback in syntactically aware IDEs.

ConstraintFactory

Helper class with properties and methods that supply a number of constraints used in Asserts.

ConstraintOperator

The ConstraintOperator class is used internally by a ConstraintBuilder to represent an operator that modifies or combines constraints. Constraint operators use left and right precedence values to determine whether the top operator on the stack should be reduced before pushing a new operator.

ContainsConstraint

ContainsConstraint tests a whether a string contains a substring or a collection contains an object. It postpones the decision of which test to use until the type of the actual argument is known. This allows testing whether a string is contained in a collection or as a substring of another string using the same syntax.

DelayedConstraint
EmptyCollectionConstraint

EmptyCollectionConstraint tests whether a collection is empty.

EmptyConstraint

EmptyConstraint tests a whether a string or collection is empty, postponing the decision about which test is applied until the type of the actual argument is known.

EmptyDirectoryConstraint
EmptyStringConstraint

EmptyStringConstraint tests whether a string is empty.

EndsWithConstraint

EndsWithConstraint can test whether a string ends with an expected substring.

EqualConstraint

EqualConstraint is able to compare an actual value with the expected value provided in its constructor. Two objects are considered equal if both are null, or if both have the same value. NUnit has special semantics for some object types.

EqualityAdapter

EqualityAdapter class handles all equality comparisons that use an IEqualityComparer, IEqualityComparer<T> or a ComparisonAdapter.

ExactCountConstraint
ExactCountOperator
ExactTypeConstraint

ExactTypeConstraint is used to test that an object is of the exact type provided in the constructor

ExceptionTypeConstraint
FailurePoint
FalseConstraint

FalseConstraint tests that the actual value is false

FloatingPointNumerics

Helper routines for working with floating point numbers

GreaterThanConstraint

Tests whether a value is greater than the value supplied to its constructor

GreaterThanOrEqualConstraint

Tests whether a value is greater than or equal to the value supplied to its constructor

InstanceOfTypeConstraint

InstanceOfTypeConstraint is used to test that an object is of the same type provided or derived from it.

LessThanConstraint

Tests whether a value is less than the value supplied to its constructor

LessThanOrEqualConstraint

Tests whether a value is less than or equal to the value supplied to its constructor

MessageWriter

MessageWriter is the abstract base for classes that write constraint descriptions and messages in some form. The class has separate methods for writing various components of a message, allowing implementations to tailor the presentation as needed.

MsgUtils

Static methods used in creating messages

NaNConstraint

NaNConstraint tests that the actual value is a double or float NaN

NoItemConstraint

NoItemConstraint applies another constraint to each item in a collection, failing if any of them succeeds.

NoneOperator

Represents a constraint that succeeds if none of the members of a collection match a base constraint.

NotConstraint

NotConstraint negates the effect of some other constraint

NotOperator

Negates the test of the constraint it wraps.

NullConstraint

NullConstraint tests that the actual value is null

NullOrEmptyStringConstraint

NullEmptyStringConstraint tests whether a string is either null or empty.

Numerics

The Numerics class contains common operations on numeric values.

NUnitComparer

NUnitComparer encapsulates NUnit's default behavior in comparing two objects.

NUnitEqualityComparer

NUnitEqualityComparer encapsulates NUnit's handling of equality tests between objects.

OrConstraint

OrConstraint succeeds if either member succeeds

OrOperator

Operator that requires at least one of it's arguments to succeed

PathConstraint

PathConstraint serves as the abstract base of constraints that operate on paths and provides several helper methods.

PredicateConstraint<T>
PrefixConstraint

Abstract base class used for prefixes

PrefixOperator

PrefixOperator takes a single constraint and modifies it's action in some way.

PropertyConstraint

PropertyConstraint extracts a named property and uses its value as the actual value for a chained constraint.

PropertyExistsConstraint

PropertyExistsConstraint tests that a named property exists on the object provided through Match. Originally, PropertyConstraint provided this feature in addition to making optional tests on the vaue of the property. The two constraints are now separate.

PropOperator

Operator used to test for the presence of a named Property on an object and optionally apply further tests to the value of that property.

RangeConstraint<T>
RegexConstraint

RegexConstraint can test whether a string matches the pattern provided.

ResolvableConstraintExpression

ResolvableConstraintExpression is used to represent a compound constraint being constructed at a point where the last operator may either terminate the expression or may have additional qualifying constraints added to it. It is used, for example, for a Property element or for an Exception element, either of which may be optionally followed by constraints that apply to the property or exception.

ReusableConstraint
SameAsConstraint

SameAsConstraint tests whether an object is identical to the object passed to its constructor

SamePathConstraint

Summary description for SamePathConstraint.

SamePathOrUnderConstraint

SamePathOrUnderConstraint tests that one path is under another

SelfResolvingOperator

Abstract base class for operators that are able to reduce to a constraint whether or not another syntactic element follows.

SomeItemsConstraint

SomeItemsConstraint applies another constraint to each item in a collection, succeeding if any of them succeeds.

SomeOperator

Represents a constraint that succeeds if any of the members of a collection match a base constraint.

StartsWithConstraint

StartsWithConstraint can test whether a string starts with an expected substring.

StringConstraint

StringConstraint is the abstract base for constraints that operate on strings. It supports the IgnoreCase modifier for string operations.

SubPathConstraint
SubstringConstraint

SubstringConstraint can test whether a string contains the expected substring.

ThrowsConstraint

ThrowsConstraint is used to test the exception thrown by a delegate by applying a constraint to it.

ThrowsNothingConstraint

ThrowsNothingConstraint tests that a delegate does not throw an exception.

ThrowsOperator

Operator that tests that an exception is thrown and optionally applies further tests to the exception.

Tolerance

The Tolerance class generalizes the notion of a tolerance within which an equality test succeeds. Normally, it is used with numeric types, but it can be used with any type that supports taking a difference between two objects and comparing that difference to a value.

TrueConstraint

TrueConstraint tests that the actual value is true

TypeConstraint

TypeConstraint is the abstract base for constraints that take a Type as their expected value.

UniqueItemsConstraint

UniqueItemsConstraint tests whether all the items in a collection are unique.

WithOperator

Represents a constraint that simply wraps the constraint provided as an argument, without any further functionality, but which modifes the order of evaluation because of its precedence.

XmlSerializableConstraint

BinarySerializableConstraint tests whether an object is serializable in binary format.

Interfaces

IResolveConstraint

The IConstraintExpression interface is implemented by all complete and resolvable constraints and expressions.

Enums

ToleranceMode

Modes in which the tolerance value for a comparison can be interpreted.

Delegates

ActualValueDelegate<T>