public void CanCompareIComparables() { ClassWithIComparable expected = new ClassWithIComparable(0); ClassWithIComparable actual = new ClassWithIComparable(42); Assert.That(actual, Is.GreaterThanOrEqualTo(expected)); }
public int CompareTo(object x) { ClassWithIComparable other = x as ClassWithIComparable; if (x is ClassWithIComparable) { return(_val.CompareTo(other._val)); } throw new ArgumentException(); }