/** Test of compareTo method, of class Time. */ @Test public void testCompareTo() { System.out.println("compareTo"); assertEquals("time == time | Time is hetzelfde", 0, time.compareTo(time)); assertEquals("time != time | Time is niet hetzelfde", 1, time.compareTo(time.plus(5))); assertEquals("time == time | Time is hetzelfde", 0, time.plus(5).compareTo(time.plus(5))); }
/** Test of difference method, of class Time. */ @Test public void testDifference() { System.out.println("difference"); Time instance = (Time) time.plus(1000); int expResult = -1000; int result = time.difference(instance); assertEquals("Resultaat moet in de min zijn", expResult, result); instance = (Time) time.plus(-1000); expResult = 1000; result = time.difference(instance); assertEquals("Resultaat moet in de plus zijn", expResult, result); }