//@@author A0142255M

package guitests;

import static org.junit.Assert.assertEquals;

import org.junit.Test;

import guitests.guihandles.TaskCardHandle;
import seedu.tache.testutil.TestTask;

public class TaskCardTest extends TaskManagerGuiTest {

    @Test
    public void showTimedTask() {
        // task with start date and time only
        TestTask taskToShow = td.eggsAndBread;
        commandBox.runCommand(taskToShow.getAddCommand());
        TaskCardHandle addedCard = taskListPanel.navigateToTask(taskToShow.getName().fullName);
        assertEquals(addedCard.getStartDate(), taskToShow.getStartDateTime().get().getDateOnly());
        assertEquals(addedCard.getStartTime(), taskToShow.getStartDateTime().get().getTimeOnly());

        // task with end date and time only
        taskToShow = td.readBook;
        commandBox.runCommand(taskToShow.getAddCommand());
        addedCard = taskListPanel.navigateToTask(taskToShow.getName().fullName);
        assertEquals(addedCard.getEndDate(), taskToShow.getEndDateTime().get().getDateOnly());
        assertEquals(addedCard.getEndTime(), taskToShow.getEndDateTime().get().getTimeOnly());

        // task with start date and time as well as end date and time
        taskToShow = td.visitGrandma;
        commandBox.runCommand(taskToShow.getAddCommand());
        addedCard = taskListPanel.navigateToTask(taskToShow.getName().fullName);
        assertEquals(addedCard.getStartDate(), taskToShow.getStartDateTime().get().getDateOnly());
        assertEquals(addedCard.getStartTime(), taskToShow.getStartDateTime().get().getTimeOnly());
        assertEquals(addedCard.getEndDate(), taskToShow.getEndDateTime().get().getDateOnly());
        assertEquals(addedCard.getEndTime(), taskToShow.getEndDateTime().get().getTimeOnly());
    }

}

@@ -560,37 +560,35 @@
 ls(addedCard.get
-Start
+End
 Date(), taskToSh
@@ -585,37 +585,35 @@
 , taskToShow.get
-Start
+End
 DateTime().get()
@@ -655,37 +655,35 @@
 ls(addedCard.get
-Start
+End
 Time(), taskToSh
@@ -680,37 +680,35 @@
 , taskToShow.get
-Start
+End
 DateTime().get()

Update Test case to check for endDateTime rather than startDateTime