Code example for Time

Methods: after, before, compare

0
    } 
 
    @Test 
    public void shouldHaveCompareAndBeforeAfter() throws Exception { 
        Time a = new Time();
        Time b = new Time();
        assertEquals(0, Time.compare(a, b));
        assertFalse(a.before(b));
        assertFalse(a.after(b));
        a.year = 2000;
        assertEquals(1, Time.compare(a, b));
        assertTrue(a.after(b));
        assertTrue(b.before(a));
        b.year = 2001;
        assertEquals(-1, Time.compare(a, b));
        assertTrue(b.after(a));
        assertTrue(a.before(b));
    } 
 
    @Test 
    public void shouldHaveParse() throws Exception {