public static void Exchange_From_IsNotGreater_To() { // Arrange var range = new Range <int>(10, 12); // Act var result = RangeHelper.ExchangeIfFromGreaterTo(range, (from, to) => from.CompareTo(to)); // Assert Assert.Equal(10, result.From); Assert.Equal(12, result.To); }
public static Range <T> ExchangeIfFromGreaterTo <T>(this Range <T> range) where T : IComparable <T> { return(RangeHelper.ExchangeIfFromGreaterTo <T>(range, (IComparer <T>)null)); }
public static Range <T> ExchangeIfFromGreaterTo <T>(this Range <T> range, Comparison <T> compare) { return(RangeHelper.ExchangeIfFromGreaterTo <T>(range, compare)); }