예제 #1
0
 public static void BeGreater <T>(Func <T> argumentFunc, T lowerLimit) where T : IComparable
 {
     if (ComparablePredicates.IsLessOrEqual(argumentFunc(), lowerLimit))
     {
         var argument = argumentFunc.GetParameter(p => p.IsLessOrEqual(lowerLimit));
         throw new ArgumentException($"The argument '{argument.Name}' must not be less than or equal to {lowerLimit}.", argument.Name);
     }
 }
예제 #2
0
 public static bool IsLessOrEqual <T>(this T first, T second) where T : struct, IComparable
 {
     return(ComparablePredicates.IsLessOrEqual(first, second));
 }