예제 #1
0
 public virtual void TestBakedUserComparator()
 {
     TestComparators.MyWritable a = new TestComparators.MyWritable(8, 8);
     TestComparators.MyWritable b = new TestComparators.MyWritable(7, 9);
     NUnit.Framework.Assert.IsTrue(a.CompareTo(b) > 0);
     NUnit.Framework.Assert.IsTrue(WritableComparator.Get(typeof(TestComparators.MyWritable
                                                                 )).Compare(a, b) < 0);
 }
예제 #2
0
 public override int Compare(WritableComparable a, WritableComparable b)
 {
     TestComparators.MyWritable aa = (TestComparators.MyWritable)a;
     TestComparators.MyWritable bb = (TestComparators.MyWritable)b;
     return(aa.j - bb.j);
 }