Class CollectionOrderedConstraint
- Namespace
- NUnit.Framework.Constraints
- Assembly
- nunit.framework.dll
CollectionOrderedConstraint is used to test whether a collection is ordered.
public class CollectionOrderedConstraint : CollectionConstraint, IConstraint, IResolveConstraint
- Inheritance
-
CollectionOrderedConstraint
- Implements
- Inherited Members
Constructors
CollectionOrderedConstraint()
Construct a CollectionOrderedConstraint
public CollectionOrderedConstraint()
Properties
Descending
If used performs a reverse comparison
public CollectionOrderedConstraint Descending { get; }
Property Value
Description
The Description of what this constraint tests, for use in messages and in the ConstraintResult.
public override string Description { get; }
Property Value
Methods
By(string)
Modifies the constraint to test ordering by the value of a specified property and returns self.
public CollectionOrderedConstraint By(string propertyName)
Parameters
propertyName
string
Returns
GetStringRepresentation()
Returns the string representation of the constraint.
protected override string GetStringRepresentation()
Returns
Matches(IEnumerable)
Test whether the collection is ordered
protected override bool Matches(IEnumerable actual)
Parameters
actual
IEnumerable
Returns
Using(IComparer)
Modifies the constraint to use an IComparer and returns self.
public CollectionOrderedConstraint Using(IComparer comparer)
Parameters
comparer
IComparer
Returns
Using<T>(IComparer<T>)
Modifies the constraint to use an IComparer<T> and returns self.
public CollectionOrderedConstraint Using<T>(IComparer<T> comparer)
Parameters
comparer
IComparer<T>
Returns
Type Parameters
T
Using<T>(Comparison<T>)
Modifies the constraint to use a Comparison<T> and returns self.
public CollectionOrderedConstraint Using<T>(Comparison<T> comparer)
Parameters
comparer
Comparison<T>
Returns
Type Parameters
T