コード例 #1
0
 @Test
 public void testCompareTo2() {
   CTime time1 = new CTime(23, 49);
   CTime time2 = new CTime(8, 45);
   assertEquals((23 * 60 + 49) - (8 * 60 + 45), time1.compareTo(time2));
 }
コード例 #2
0
 @Test
 public void testCompareTo3() {
   CTime time1 = new CTime(15, 55);
   CTime time2 = new CTime(15, 55);
   assertEquals(0, time1.compareTo(time2));
 }
コード例 #3
0
 // Test about compareTo,including 3 types of results:positive,minus integer,0
 @Test
 public void testCompareTo1() {
   CTime time1 = new CTime(11, 22);
   CTime time2 = new CTime(23, 33);
   assertEquals((11 * 60 + 22) - (23 * 60 + 33), time1.compareTo(time2));
 }