Exemplo n.º 1
0
        public void CanCompareIComparables()
        {
            ClassWithIComparable expected = new ClassWithIComparable(0);
            ClassWithIComparable actual   = new ClassWithIComparable(42);

            Assert.That(actual, Is.GreaterThanOrEqualTo(expected));
        }
Exemplo n.º 2
0
        public int CompareTo(object x)
        {
            ClassWithIComparable other = x as ClassWithIComparable;

            if (x is ClassWithIComparable)
            {
                return(_val.CompareTo(other._val));
            }

            throw new ArgumentException();
        }