CollectionOrderedConstraint - samuelneff/docs GitHub Wiki
CollectionOrderedConstraint tests that an IEnumerable
is ordered. If the actual value passed does not implement IEnumerable
, an exception is thrown.
CollectionOrderedConstraint()
Is.Ordered
...Descending
...By(string propertyName)
...Using(IComparer comparer)
...Using<T>(IComparer<T> comparer)
...Using<T>(Comparison<T> comparer)
int[] iarray = new int[] { 1, 2, 3 };
string[] sarray = new string[] { "c", "b", "a" };
string[] sarray2 = new string[] ( "a", "aa", "aaa" );
Assert.That( iarray, Is.Ordered );
Assert.That( sarray, Is.Ordered.Descending );
Assert.That( sarray2, Is.Ordered.By("Length");
- Modifiers may be combined and may appear in any order. If the same modifier is used more than once, the result is undefined.