public void DefaultKeyValueComparerGeneric() { IComparer <KeyValuePair <GOddEvenComparable, short> > comparer = Comparers.DefaultKeyValueComparer <GOddEvenComparable, short>(); Assert.IsTrue(comparer.Compare(new KeyValuePair <GOddEvenComparable, short>(new GOddEvenComparable(7), 12), new KeyValuePair <GOddEvenComparable, short>(new GOddEvenComparable(6), 19)) < 0); Assert.IsTrue(comparer.Compare(new KeyValuePair <GOddEvenComparable, short>(new GOddEvenComparable(7), 133), new KeyValuePair <GOddEvenComparable, short>(new GOddEvenComparable(8), 1)) < 0); Assert.IsTrue(comparer.Compare(new KeyValuePair <GOddEvenComparable, short>(new GOddEvenComparable(12), 34), new KeyValuePair <GOddEvenComparable, short>(new GOddEvenComparable(11), 3)) > 0); Assert.IsTrue(comparer.Compare(new KeyValuePair <GOddEvenComparable, short>(new GOddEvenComparable(12), 8), new KeyValuePair <GOddEvenComparable, short>(new GOddEvenComparable(143), 6)) > 0); Assert.IsTrue(comparer.Compare(new KeyValuePair <GOddEvenComparable, short>(new GOddEvenComparable(5), 1), new KeyValuePair <GOddEvenComparable, short>(new GOddEvenComparable(7), 0)) < 0); Assert.IsTrue(comparer.Compare(new KeyValuePair <GOddEvenComparable, short>(new GOddEvenComparable(9), 3), new KeyValuePair <GOddEvenComparable, short>(new GOddEvenComparable(5), 23)) > 0); Assert.IsTrue(comparer.Compare(new KeyValuePair <GOddEvenComparable, short>(new GOddEvenComparable(6), 5), new KeyValuePair <GOddEvenComparable, short>(new GOddEvenComparable(8), 4)) < 0); Assert.IsTrue(comparer.Compare(new KeyValuePair <GOddEvenComparable, short>(new GOddEvenComparable(14), 1), new KeyValuePair <GOddEvenComparable, short>(new GOddEvenComparable(-8), 0)) > 0); Assert.IsTrue(comparer.Compare(new KeyValuePair <GOddEvenComparable, short>(new GOddEvenComparable(0), 4), new KeyValuePair <GOddEvenComparable, short>(new GOddEvenComparable(0), 17)) == 0); Assert.IsTrue(comparer.Compare(new KeyValuePair <GOddEvenComparable, short>(new GOddEvenComparable(-3), 2), new KeyValuePair <GOddEvenComparable, short>(new GOddEvenComparable(-3), 1)) == 0); }