package seedu.jobs.model.task;

import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;

import org.junit.Test;


import seedu.jobs.model.task.Time;

public class TimeTest {

    @Test
    public void isValidTime() {
        // invalid Time
        assertFalse(Time.isValidTime("")); // empty string
        assertFalse(Time.isValidTime(" ")); // spaces only
        assertFalse(Time.isValidTime("12/12/2016")); // incomplete time declaration
        assertFalse(Time.isValidTime("12/12/2016 12")); // incomplete time declaration
        assertFalse(Time.isValidTime("12/12/2016 12:")); // incomplete time declaration
        assertFalse(Time.isValidTime("9/12/1993 5:2")); //no preceding zero in the minute portion
        assertFalse(Time.isValidTime("9/12/1993 05:00")); //no preceding zero in the day
        assertFalse(Time.isValidTime("09/9/1993 05:00")); //no preceding zero in the month
        assertFalse(Time.isValidTime("31/11/1993 05:00")); //non existent date
        assertFalse(Time.isValidTime("30/11/1993 25:00")); //non existent time
        
        // valid Time
        assertTrue(Time.isValidTime("09/12/1993 15:00")); //preceding zero in the date
        
    }
}

@@ -66,83 +66,263 @@
 sert
-False;%0Aimport static org.junit.Assert.assertTrue;%0A%0Aimport org.junit.Test;%0A%0A
+Equals;%0Aimport static org.junit.Assert.assertNotEquals;%0Aimport static org.junit.Assert.assertFalse;%0Aimport static org.junit.Assert.assertTrue;%0A%0Aimport java.util.Optional;%0A%0Aimport org.junit.Test;%0A%0Aimport seedu.jobs.commons.exceptions.IllegalValueException;
 %0Aimp
@@ -1391,10 +1391,519 @@
  %0A    %7D%0A
+    %0A    @Test%0A    public void timeEquality() throws IllegalValueException%7B%0A    %09 // testing for time addition%0A        Time oldTime = new Time(Optional.of(%2209/12/1993 12:00%22));%0A        assertEquals(oldTime,new Time(Optional.of(%2209/12/1993 12:00%22)));%0A        assertNotEquals(oldTime,new Time(Optional.of(%2209/12/1993 16:00%22)));%0A        oldTime.addDays(7);%0A        assertNotEquals(oldTime,new Time(Optional.of(%2209/12/1993 12:00%22)));%0A        assertEquals(oldTime,new Time(Optional.of(%2216/12/1993 12:00%22)));%0A    %7D%0A
 %7D%0A

Add new test cases for TimeTest.java