Ejemplo n.º 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);
 }
Ejemplo n.º 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);
 }