package utask.model.task;

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

import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;

import utask.commons.exceptions.IllegalValueException;
//@@author A0138423J
public class DeadlineTest {
    @Rule
    public ExpectedException thrown = ExpectedException.none();

    @Test
    public void isValidDeadline() {
        // invalid Deadline
        assertFalse(Deadline.isValidDeadline("")); // empty string
        assertFalse(Deadline.isValidDeadline(" ")); // spaces only
        assertFalse(Deadline.isValidDeadline("jan")); // non-numeric
        assertFalse(Deadline.isValidDeadline("13jan17")); // alphabets within digits
        assertFalse(Deadline.isValidDeadline("13 01 17")); // spaces within digits
        assertFalse(Deadline.isValidDeadline("310417")); // no 31st day in April
        // valid phone numbers
        assertTrue(Deadline.isValidDeadline("300406"));  // support backdated
        assertTrue(Deadline.isValidDeadline("130117"));
        assertTrue(Deadline.isValidDeadline("090820"));
    }

    @Test
    public void validDeadlineConstructor() throws IllegalValueException {
        Deadline d = Deadline.getEmptyDeadline(); // empty constructor
        assertEquals(d.hashCode(), "".hashCode()); //checking hashCode when Deadline is Null
    }

    @Test
    public void removeDeadlineConstructor() throws IllegalValueException {
        String value = "-";
        Deadline d = new Deadline(value); // constructor with dash only
        assertEquals(d.toString(), ""); //checking toString() value when Deadline is Null
    }

    @Test(expected = IllegalValueException.class)
    public void invalidDeadlineConstructor() throws IllegalValueException {
        Deadline d = new Deadline("$%^&*("); // constructor with random symbols
    }
}

@@ -153,16 +153,40 @@
 tTrue;%0A%0A
+import java.util.Date;%0A%0A
 import o
@@ -1275,32 +1275,293 @@
 alueException %7B%0A
+        Date date = new Date();%0A        Deadline d = new Deadline(date); // Date constructor%0A        assertEquals(d.getDate(), date); //checking if both dates tally%0A    %7D%0A%0A    @Test%0A    public void validEmptyDeadlineConstructor() throws IllegalValueException %7B%0A
         Deadline

Update DeadlineTest