Beispiel #1
0
        public void CanCompareIComparablesOfT()
        {
            ClassWithIComparableOfT expected = new ClassWithIComparableOfT(0);
            ClassWithIComparableOfT actual   = new ClassWithIComparableOfT(42);

            Assert.That(actual, Is.GreaterThan(expected));
        }
        public void CanCompareIComparablesOfInt()
        {
            int expected = 42;
            ClassWithIComparableOfT actual = new ClassWithIComparableOfT(0);

            Assert.That(actual, Is.LessThanOrEqualTo(expected));
        }
Beispiel #3
0
        public void CanCompareIComparablesOfInt()
        {
            int expected = 0;
            ClassWithIComparableOfT actual = new ClassWithIComparableOfT(42);

            Assert.That(actual, Is.GreaterThanOrEqualTo(expected));
        }
        public void ComparablesOfInt3()
        {
            short greater = 42;
            var   lesser  = new ClassWithIComparableOfT(-42);

            Assert.That(comparer.Compare(greater, lesser) > 0);
            Assert.That(comparer.Compare(lesser, greater) < 0);
        }
        public void ComparablesOfInt2()
        {
            var greater = new ClassWithIComparableOfT(42);
            int lesser  = -42;

            Assert.That(comparer.Compare(greater, lesser) > 0);
            Assert.That(comparer.Compare(lesser, greater) < 0);
        }