-
Notifications
You must be signed in to change notification settings - Fork 155
CollectionOrderedConstraint
Chris Maddock edited this page Feb 14, 2016
·
7 revisions
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.
Copyright (c) 2018 The NUnit Project - Licensed under CC BY-NC-SA 4.0
-
NUnit
-
Release Notes
-
License
- Getting Started
- Writing Tests
- Running Tests
- Extending NUnit
- Technical Notes
-
Release Notes
- NUnit Xamarin Runners
- VS Test Adapter
- VS Test Generator
- NUnit Analyzers