IGLib
1.7.2
The IGLib base library EXTENDED - with other lilbraries and applications.
|
Abstract base class for constraints that compare _values to determine if one is greater than, equal to or less than the other. More...
Public Member Functions | |
override ConstraintResult | ApplyTo< TActual > (TActual actual) |
Test whether the constraint is satisfied by a given value More... | |
ComparisonConstraint | Using (IComparer comparer) |
Modifies the constraint to use an IComparer and returns self More... | |
ComparisonConstraint | Using< T > (IComparer< T > comparer) |
Modifies the constraint to use an IComparer{T} and returns self More... | |
ComparisonConstraint | Using< T > (Comparison< T > comparer) |
Modifies the constraint to use a Comparison{T} and returns self More... | |
![]() | |
virtual ConstraintResult | ApplyTo< TActual > (ActualValueDelegate< TActual > del) |
Applies the constraint to 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. More... | |
virtual ConstraintResult | ApplyTo< TActual > (ref TActual actual) |
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. More... | |
override string | ToString () |
Default override of ToString returns the constraint DisplayName followed by any arguments within angle brackets. More... | |
DelayedConstraint | After (int delayInMilliseconds) |
Returns a DelayedConstraint with the specified delay time. More... | |
DelayedConstraint | After (int delayInMilliseconds, int pollingInterval) |
Returns a DelayedConstraint with the specified delay time and polling interval. More... | |
Protected Member Functions | |
ComparisonConstraint (object value, bool lessComparisonResult, bool equalComparisonResult, bool greaterComparisonResult, string predicate) | |
Initializes a new instance of the ComparisonConstraint class. More... | |
![]() | |
Constraint (params object[] args) | |
Construct a constraint with optional arguments More... | |
virtual string | GetStringRepresentation () |
Returns the string representation of this constraint More... | |
Protected Attributes | |
object | expected |
The value against which a comparison is to be made More... | |
bool | lessComparisonResult = false |
If true, less than returns success More... | |
bool | equalComparisonResult = false |
if true, equal returns success More... | |
bool | greaterComparisonResult = false |
if true, greater than returns success More... | |
Private Attributes | |
ComparisonAdapter | comparer = ComparisonAdapter.Default |
ComparisonAdapter to be used in making the comparison More... | |
Additional Inherited Members | |
![]() | |
static Constraint | operator& (Constraint left, Constraint right) |
This operator creates a constraint that is satisfied only if both argument constraints are satisfied. More... | |
static Constraint | operator| (Constraint left, Constraint right) |
This operator creates a constraint that is satisfied if either of the argument constraints is satisfied. More... | |
static Constraint | operator! (Constraint constraint) |
This operator creates a constraint that is satisfied if the argument constraint is not satisfied. More... | |
![]() | |
string | DisplayName [get, protected set] |
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. More... | |
virtual string | Description [get, protected set] |
The Description of what this constraint tests, for use in messages and in the ConstraintResult. More... | |
object[] | Arguments [get, private set] |
Arguments provided to this Constraint, for use in formatting the description. More... | |
ConstraintBuilder | Builder [get, set] |
The ConstraintBuilder holding this constraint More... | |
ConstraintExpression | And [get] |
Returns a ConstraintExpression by appending And to the current constraint. More... | |
ConstraintExpression | With [get] |
Returns a ConstraintExpression by appending And to the current constraint. More... | |
ConstraintExpression | Or [get] |
Returns a ConstraintExpression by appending Or to the current constraint. More... | |
![]() | |
string | DisplayName [get] |
The display name of this Constraint for use by ToString(). More... | |
string | Description [get] |
The Description of what this constraint tests, for use in messages and in the ConstraintResult. More... | |
object[] | Arguments [get] |
Arguments provided to this Constraint, for use in formatting the description. More... | |
ConstraintBuilder | Builder [get, set] |
The ConstraintBuilder holding this constraint More... | |
Abstract base class for constraints that compare _values to determine if one is greater than, equal to or less than the other.
|
inlineprotected |
Initializes a new instance of the ComparisonConstraint class.
value | The value against which to make a comparison. |
lessComparisonResult | if set to true less succeeds. |
equalComparisonResult | if set to true equal succeeds. |
greaterComparisonResult | if set to true greater succeeds. |
predicate | String used in describing the constraint. |
|
inlinevirtual |
Test whether the constraint is satisfied by a given value
actual | The value to be tested |
Implements NUnit.Framework.Constraints.Constraint.
References NUnit.Framework.Constraints.ComparisonAdapter.Compare().
|
inline |
Modifies the constraint to use an IComparer and returns self
comparer | The comparer used for comparison tests |
References NUnit.Framework.Constraints.ComparisonAdapter.For().
Referenced by NUnit.Framework.Constraints.ComparisonConstraintTestBase.UsesProvidedGenericComparer(), NUnit.Framework.Constraints.ComparisonConstraintTestBase.UsesProvidedGenericComparison(), NUnit.Framework.Constraints.ComparisonConstraintTestBase.UsesProvidedIComparer(), and NUnit.Framework.Constraints.ComparisonConstraintTestBase.UsesProvidedLambda().
|
inline |
Modifies the constraint to use an IComparer{T} and returns self
comparer | The comparer used for comparison tests |
References NUnit.Framework.Constraints.ComparisonAdapter.For().
|
inline |
Modifies the constraint to use a Comparison{T} and returns self
comparer | The comparer used for comparison tests |
References NUnit.Framework.Constraints.ComparisonAdapter.For().
|
protected |
The value against which a comparison is to be made
|
protected |
If true, less than returns success
|
protected |
if true, equal returns success
|
protected |
if true, greater than returns success
|
private |
ComparisonAdapter to be used in making the comparison