public static void BeLess <T>(Func <T> argumentFunc, T upperLimit) where T : IComparable { if (ComparablePredicates.IsGreaterOrEqual(argumentFunc(), upperLimit)) { var argument = argumentFunc.GetParameter(p => ComparablePredicates.IsGreaterOrEqual(p, upperLimit)); throw new ArgumentException($"The argument '{argument.Name}' must not be greater than or equal to {upperLimit}.", argument.Name); } }
public static bool IsGreaterOrEqual <T>(this T first, T second) where T : struct, IComparable { return(ComparablePredicates.IsGreaterOrEqual(first, second)); }