Useful C# method for unit testing

I’m unit testing a UI that needs to show some lists in various sorted orders, and I wanted to ensure that my tests would cover that. I found this method to come in handy:   1: public static bool IsOrderedBy<T>(this IEnumerable<T> coll, 2: Func<T, IComparable> val) 3: { 4: if (coll == null || coll.Count()…

3