NUnit.Framework.Constraints.Constraint Members

The members of NUnit.Framework.Constraints.Constraint are listed below.

See Also: Inherited members from System.Object

Protected Constructors

Construct a constraint with no arguments
Construct a constraint with one argument
Construct a constraint with two arguments

Protected Fields

actualobject. The actual value being tested against a constraint
static
UNSETobject. Static UnsetObject used to detect derived constraints failing to set the actual value.

Public Properties

[read-only]
AndNUnit.Framework.Constraints.ConstraintExpression. Returns a ConstraintExpression by appending And to the current constraint.
[read-only]
OrNUnit.Framework.Constraints.ConstraintExpression. Returns a ConstraintExpression by appending Or to the current constraint.
[read-only]
WithNUnit.Framework.Constraints.ConstraintExpression. Returns a ConstraintExpression by appending And to the current constraint.

Protected Properties

DisplayNamestring. 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.

Public Methods

After(int) : NUnit.Framework.Constraints.DelayedConstraint
Documentation for this section has not yet been entered.
After(int, int) : NUnit.Framework.Constraints.DelayedConstraint
Documentation for this section has not yet been entered.
abstract
Matches(object) : bool
Test whether the constraint is satisfied by a given value
Matches<T>(NUnit.Framework.Constraints.ActualValueDelegate<T>) : bool
Documentation for this section has not yet been entered.
Matches<T>(ref T) : bool
Documentation for this section has not yet been entered.
override
ToString() : string
Default override of ToString returns the constraint DisplayName followed by any arguments within angle brackets.
WriteActualValueTo(NUnit.Framework.Constraints.MessageWriter)
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.
abstract
WriteDescriptionTo(NUnit.Framework.Constraints.MessageWriter)
Write the constraint description to a MessageWriter
WriteMessageTo(NUnit.Framework.Constraints.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.

Protected Methods

GetStringRepresentation() : string
Documentation for this section has not yet been entered.

Public Operators

static
BitwiseAnd(NUnit.Framework.Constraints.Constraint, NUnit.Framework.Constraints.Constraint) This operator creates a constraint that is satisfied only if both argument constraints are satisfied.
static
BitwiseOr(NUnit.Framework.Constraints.Constraint, NUnit.Framework.Constraints.Constraint) This operator creates a constraint that is satisfied if either of the argument constraints is satisfied.
static
LogicalNot This operator creates a constraint that is satisfied if the argument constraint is not satisfied.

Explicitly Implemented Interface Members

NUnit.Framework.Constraints.IResolveConstraint.ResolveDocumentation for this section has not yet been entered.