コード例 #1
0
        public void CanCompareIComparablesOfT()
        {
            ClassWithIComparableOfT expected = new ClassWithIComparableOfT(0);
            ClassWithIComparableOfT actual   = new ClassWithIComparableOfT(42);

            Assert.That(actual, Is.GreaterThan(expected));
        }
コード例 #2
0
        public void CanCompareIComparablesOfInt()
        {
            int expected = 42;
            ClassWithIComparableOfT actual = new ClassWithIComparableOfT(0);

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

            Assert.That(actual, Is.GreaterThanOrEqualTo(expected));
        }
コード例 #4
0
        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);
        }
コード例 #5
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);
        }