I'm using MVP with ASP.NET Web Forms. Being a good TDDer, I want to test all the important behaviors in my Presenter, including the default sort it applies to the result set retrieved from the service layer. The Presenter will be applying a nested sort via LINQ to Objects of the style:
public IEnumerable<ViewModel> MyModel{
get
{
return _myService.GetResults().OrderBy(r=>r.PropertyA).ThenBy(r1=>r1.PropertyB);
}
}
I've looked at the IsOrderedBy extension method described in this SO question, but I'm not sure how to extend it to work with the nested sort I describe above. Ditto for the code posted by Jon Skeet in this SO question.