ComparisonConstraint Class

Definition

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

public abstract class ComparisonConstraint : NUnit.Framework.Constraints.Constraint
type ComparisonConstraint = class
    inherit Constraint
Inheritance
ComparisonConstraint
Derived

Constructors

ComparisonConstraint(Object)
ComparisonConstraint(Object, Object)

Fields

actual

The actual value being tested against a constraint

(Inherited from Constraint)
comparer

Properties

And

Returns a ConstraintExpression by appending And to the current constraint.

(Inherited from Constraint)
DisplayName

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.

(Inherited from Constraint)
Or

Returns a ConstraintExpression by appending Or to the current constraint.

(Inherited from Constraint)
With

Returns a ConstraintExpression by appending And to the current constraint.

(Inherited from Constraint)

Methods

After(Int32) (Inherited from Constraint)
After(Int32, Int32) (Inherited from Constraint)
GetStringRepresentation() (Inherited from Constraint)
Matches(Object)

Test whether the constraint is satisfied by a given value

(Inherited from Constraint)
Matches<T>(ActualValueDelegate<T>) (Inherited from Constraint)
Matches<T>(T) (Inherited from Constraint)
ToString()

Default override of ToString returns the constraint DisplayName followed by any arguments within angle brackets.

(Inherited from Constraint)
Using(IComparer)

Modifies the constraint to use an IComparer and returns self

Using<T>(Comparison<T>)

Modifies the constraint to use a Comparison<T> and returns self

Using<T>(IComparer<T>)

Modifies the constraint to use an IComparer<T> and returns self

WriteActualValueTo(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.

(Inherited from Constraint)
WriteDescriptionTo(MessageWriter)

Write the constraint description to a MessageWriter

(Inherited from Constraint)
WriteMessageTo(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.

(Inherited from Constraint)

Explicit Interface Implementations

IResolveConstraint.Resolve() (Inherited from Constraint)

Applies to