title: Simple sort verification for unit testing an ORDER BY?
body: <p>I'm working on a DAL method that uses an ORDER BY clause in a SELECT.  The return value from the method is an <code>IEnumerable&lt;T&gt;</code>, where T is a class that encapsulates a domain entity, and the sort order would be based on one of the properties of this class, namely, "Priority."  It's important that this ORDER BY works, of course, so I want to write a sort verification into the unit test for this method.  Does anyone have a quick and simple algorithm for testing the order of an <code>IEnumerable&lt;T&gt;</code> based on one of the properties of T?  Is there something LINQ-y that I can use?</p>
  
  <pre><code>var items = repository.GetItems(true);   //true tells it to use the ORDER BY
  items.ToList().ForEach(i =&gt; Assert.IsTrue(??What happens here??));
  </code></pre>
  
  <p>Thanks in advance.</p>