package utask.model.task;

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

import org.junit.Test;

public class DeadlineTest {

    @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"));
    }
}

@@ -20,16 +20,61 @@
 .task;%0A%0A
+import static org.junit.Assert.assertEquals;%0A
 import s
@@ -177,16 +177,72 @@
 .Test;%0A%0A
+import utask.commons.exceptions.IllegalValueException;%0A%0A
 public c
@@ -1014,11 +1014,580 @@
 );%0A    %7D
+%0A%0A    @Test%0A    public void testConstructor() %7B%0A        Deadline d;%0A        try %7B%0A            d = new Deadline(%22-%22); // constructor with dash only%0A            assertEquals(d, null);%0A%0A            d = Deadline.getEmptyDeadline(); // empty constructor%0A            assertEquals(d, null);%0A%0A            assertEquals(d.toString(), %22%22); //checking toString() value when Deadline is Null%0A            assertEquals(d.hashCode(), %22%22.hashCode()); //checking hashCode when Deadline is Null%0A        %7D catch (IllegalValueException e) %7B%0A            e.printStackTrace();%0A        %7D%0A%0A    %7D
 %0A%7D%0A

Add more test cases for Deadline