Class CollectionOrderedConstraint
CollectionOrderedConstraint is used to test whether a collection is ordered.
Inheritance
CollectionOrderedConstraint
Assembly: nunit.framework.dll
Syntax
public class CollectionOrderedConstraint : CollectionConstraint, IConstraint, IResolveConstraint
Constructors
View Source
CollectionOrderedConstraint()
Construct a CollectionOrderedConstraint
Declaration
public CollectionOrderedConstraint()
Properties
View Source
Ascending
If used performs a default ascending comparison
Declaration
public CollectionOrderedConstraint Ascending { get; }
Property Value
View Source
Descending
If used performs a reverse comparison
Declaration
public CollectionOrderedConstraint Descending { get; }
Property Value
View Source
Description
The Description of what this constraint tests, for
use in messages and in the ConstraintResult.
Declaration
public override string Description { get; }
Property Value
Overrides
View Source
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.
Declaration
public override string DisplayName { get; }
Property Value
Overrides
View Source
Then
Then signals a break between two ordering steps
Declaration
public CollectionOrderedConstraint Then { get; }
Property Value
Methods
View Source
ApplyTo<TActual>(TActual)
Test whether the constraint is satisfied by a given value
Declaration
public override ConstraintResult ApplyTo<TActual>(TActual actual)
Parameters
Type |
Name |
Description |
TActual |
actual |
The value to be tested
|
Returns
Type Parameters
Overrides
View Source
By(string)
Modifies the constraint to test ordering by the value of
a specified property and returns self.
Declaration
public CollectionOrderedConstraint By(string propertyName)
Parameters
Type |
Name |
Description |
string |
propertyName |
|
Returns
View Source
GetStringRepresentation()
Returns the string representation of the constraint.
Declaration
protected override string GetStringRepresentation()
Returns
Overrides
View Source
Matches(IEnumerable)
Test whether the collection is ordered
Declaration
protected override bool Matches(IEnumerable actual)
Parameters
Returns
Overrides
View Source
Using(IComparer)
Modifies the constraint to use an IComparer and returns self.
Declaration
public CollectionOrderedConstraint Using(IComparer comparer)
Parameters
Returns
View Source
Using<T>(IComparer<T>)
Modifies the constraint to use an IComparer<T> and returns self.
Declaration
public CollectionOrderedConstraint Using<T>(IComparer<T> comparer)
Parameters
Returns
Type Parameters
View Source
Using<T>(Comparison<T>)
Declaration
public CollectionOrderedConstraint Using<T>(Comparison<T> comparer)
Parameters
Returns
Type Parameters
Implements