Reputation: 2309
I would like to do something along the lines of...
Assert.That(collection, Has.Item("two").After.Item("one"))
Is this possible with NUnit?
Upvotes: 3
Views: 138
Reputation: 2309
From the looks of this page, I'm out of luck this time (thanks @canton7). A suggestion was made to make a custom constraint, which I find fascinating, but probably an overkill for this scenario.
Here's how I ended up doing it:
Assert.That(collection.IndexOf("two"), Is.GreaterThan(collection.IndexOf("one")))
Upvotes: 2