示例#1
0
        public void comparison_asserts_should_use_greaterthan_and_lessthan_overloads_for_classes_that_do_not_implement_icomparable_or_icomparableT()
        {
            Assert.GreaterThan(new DerivedFromOverloadsComparisonOperators(2), new OverloadsComparisonOperators(1));
            Assert.GreaterThanOrEqual(new OverloadsComparisonOperators(2), new DerivedFromOverloadsComparisonOperators(1));
            Assert.GreaterThanOrEqual(new DerivedFromOverloadsComparisonOperators(2), new OverloadsComparisonOperators(2));

            Assert.LessThan(new OverloadsComparisonOperators(1), new DerivedFromOverloadsComparisonOperators(2));
            Assert.LessThanOrEqual(new DerivedFromOverloadsComparisonOperators(1), new OverloadsComparisonOperators(2));
            Assert.LessThanOrEqual(new OverloadsComparisonOperators(2), new DerivedFromOverloadsComparisonOperators(2));
        }
示例#2
0
 public void a_is_greater_than_or_equal_to_A_using_case_insensitive_ordinal_comparer_should_pass()
 {
     Assert.GreaterThanOrEqual("a", "A", StringComparer.OrdinalIgnoreCase);
 }
示例#3
0
 public void a_is_not_greater_than_or_equal_to_b_should_fail()
 {
     Assert.Throws <GreaterThanOrEqualException>(() => Assert.GreaterThanOrEqual("a", "b"));
 }
示例#4
0
 public void b_is_greater_than_or_equal_to_a_should_pass()
 {
     Assert.GreaterThanOrEqual("b", "a");
 }
示例#5
0
 public void Today_is_not_greater_than_or_equal_to_tomorrow_should_fail()
 {
     Assert.Throws <GreaterThanOrEqualException>(() => Assert.GreaterThanOrEqual(today, tomorrow));
 }
示例#6
0
 public void Tomorrow_is_greater_than_or_equal_to_today_should_pass()
 {
     Assert.GreaterThanOrEqual(tomorrow, today);
 }
示例#7
0
 public void One_is_not_greater_than_or_equal_to_two_should_fail()
 {
     Assert.Throws <GreaterThanOrEqualException>(() => Assert.GreaterThanOrEqual(1, 2));
 }
示例#8
0
 public void Two_is_greater_than_or_equal_to_one_should_pass()
 {
     Assert.GreaterThanOrEqual(2, 1);
 }
示例#9
0
        public void should_test_equality_if_niether_icomparable_and_icomparableT_are_implemented()
        {
            var obj = new ClassWithNoComparisonBehavior();

            Assert.GreaterThanOrEqual(obj, obj);
        }