//@@author A0147996E
package guitests;

import static org.junit.Assert.assertTrue;

import org.junit.Test;

import seedu.address.commons.core.Messages;
import seedu.address.testutil.TestTask;

public class ViewCommandTest extends TaskManagerGuiTest {

    @Test
    public void view_viewNextNDays_viewSuccess() {
        commandBox.runCommand(td.homework.getAddCommand());
        commandBox.runCommand(td.homework2.getAddCommand());
        assertViewResult("view next/1",  td.homework, td.homework2);
        assertViewResult("view next/1000", td.homework, td.homework2, td.assignment,
            td.gym, td.gym2, td.gym3, td.cs2103, td.date, td.study);
    }

    @Test
    public void view_viewOnNDays_viewSuccess() {
        commandBox.runCommand(td.homework.getAddCommand());
        commandBox.runCommand(td.homework2.getAddCommand());
        assertViewResult("view next/1",  td.homework, td.homework2);
        assertViewResult("view next/1000", td.homework, td.homework2, td.assignment,
            td.gym, td.gym2, td.gym3, td.cs2103, td.date, td.study);
    }

    @Test
    public void view_invalidCommand_unknownCommand() {
        commandBox.runCommand("views next/10");
        assertResultMessage(Messages.MESSAGE_UNKNOWN_COMMAND);

        commandBox.runCommand("viewnext /10");
        assertResultMessage(Messages.MESSAGE_UNKNOWN_COMMAND);
    }

    private void assertViewResult(String command, TestTask... expectedHits) {
        commandBox.runCommand(command);
        assertListSize(expectedHits.length);
        assertTrue(taskListPanel.isListMatching(expectedHits));
    }
}

@@ -649,32 +649,558 @@
 .study);%0A    %7D%0A%0A
+    @Test%0A    public void view_viewNextDate_viewSuccess() %7B%0A        assertViewResult(%22view next/01/01/2018%22, td.assignment, td.gym, td.gym2, td.gym3);%0A        assertViewResult(%22view next/01/01/2050%22, td.homework, td.homework2, td.assignment,%0A            td.gym, td.gym2, td.gym3, td.cs2103, td.date, td.study);%0A    %7D%0A    @Test%0A    public void view_viewNext_illegalParam() %7B%0A        commandBox.runCommand(%22view next/-1%22);%0A        commandBox.runCommand(%22view next/01/04/2017%22);%0A        //TODO: expecting exception message%0A    %7D%0A
     @Test%0A    pu
@@ -1386,38 +1386,38 @@
 iewResult(%22view 
-next/1
+on/tmr
 %22,  td.homework,
@@ -1440,155 +1440,175 @@
     
-    assertViewResult(%22view next/1000%22, td.homework, td.homework2, td.assignment,%0A            td.gym, td.gym2, td.gym3, td.cs2103, td.date, td.study
+%7D%0A    @Test%0A    public void view_viewOnDate_viewSuccess() %7B%0A        assertViewResult(%22view on/20/12/2017%22, td.gym);%0A        assertViewResult(%22view on/01/02%22, td.cs2103
 );%0A 

Update view command test