示例#1
0
        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);
        }
示例#2
0
 public static Range <T> ExchangeIfFromGreaterTo <T>(this Range <T> range)
     where T : IComparable <T>
 {
     return(RangeHelper.ExchangeIfFromGreaterTo <T>(range, (IComparer <T>)null));
 }
示例#3
0
 public static Range <T> ExchangeIfFromGreaterTo <T>(this Range <T> range, Comparison <T> compare)
 {
     return(RangeHelper.ExchangeIfFromGreaterTo <T>(range, compare));
 }