//------------------------------------------------------------------------- public virtual void test_compareTo() { ObjDoublePair <string> p12 = ObjDoublePair.of("1", 2d); ObjDoublePair <string> p13 = ObjDoublePair.of("1", 3d); ObjDoublePair <string> p21 = ObjDoublePair.of("2", 1d); assertTrue(p12.CompareTo(p12) == 0); assertTrue(p12.CompareTo(p13) < 0); assertTrue(p12.CompareTo(p21) < 0); assertTrue(p13.CompareTo(p12) > 0); assertTrue(p13.CompareTo(p13) == 0); assertTrue(p13.CompareTo(p21) < 0); assertTrue(p21.CompareTo(p12) > 0); assertTrue(p21.CompareTo(p13) > 0); assertTrue(p21.CompareTo(p21) == 0); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test(expectedExceptions = ClassCastException.class) public void test_compareTo_notComparable() public virtual void test_compareTo_notComparable() { ThreadStart notComparable = () => { }; ObjDoublePair <ThreadStart> test1 = ObjDoublePair.of(notComparable, 2d); ObjDoublePair <ThreadStart> test2 = ObjDoublePair.of(notComparable, 2d); test1.CompareTo(test2); }