Constraint
The Constraint class is the base of all built-in constraints
within NUnit. It provides the operator overloads used to combine
constraints.
Static UnsetObject used to detect derived constraints
failing to set the actual value.
The actual value being tested against a constraint
Returns a ConstraintExpression by appending And
to the current constraint.
The display name of this Constraint for use by ToString().
The default value is the name of the constraint with
trailing "Constraint" removed. Derived classes may set
this to another name in their constructors.
Returns a ConstraintExpression by appending Or
to the current constraint.
Returns a ConstraintExpression by appending And
to the current constraint.
public Constraint()
Construct a constraint with no arguments
Construct a constraint with one argument
Construct a constraint with two arguments
This operator creates a constraint that is satisfied only if both
argument constraints are satisfied.
This operator creates a constraint that is satisfied if either
of the argument constraints is satisfied.
This operator creates a constraint that is satisfied if the
argument constraint is not satisfied.
Returns a DelayedConstraint with the specified delay time.
Returns a DelayedConstraint with the specified delay time
and polling interval.
Returns the string representation of this constraint
Test whether the constraint is satisfied by a given value
Test whether the constraint is satisfied by an
ActualValueDelegate that returns the value to be tested.
The default implementation simply evaluates the delegate
but derived classes may override it to provide for delayed
processing.
Test whether the constraint is satisfied by a given reference.
The default implementation simply dereferences the value but
derived classes may override it to provide for delayed processing.
Write the actual value for a failing constraint test to a
MessageWriter. The default implementation simply writes
the raw value of actual, leaving it to the writer to
perform any formatting.
Write the constraint description to a MessageWriter
Write the failure message to the MessageWriter provided
as an argument. The default implementation simply passes
the constraint and the actual value to the writer, which
then displays the constraint description and the value.
Constraints that need to provide additional details,
such as where the error occured can override this.