//@@author A0147996E

package guitests;

public class UndoCommandTest {

}

@@ -18,58 +18,2236 @@
 96E%0A
-%0Apackage guitests;%0A%0Apublic class UndoCommandTest %7B%0A
+package guitests;%0A%0Aimport static org.junit.Assert.assertTrue;%0Aimport static seedu.address.logic.commands.UndoCommand.MESSAGE_SUCCESS;%0A%0Aimport org.junit.Test;%0A%0Aimport seedu.address.testutil.TestEvent;%0Aimport seedu.address.testutil.TestTask;%0A%0Apublic class UndoCommandTest extends TaskManagerGuiTest %7B%0A%0A    @Test%0A    public void undo_add() %7B%0A        TestTask%5B%5D currentList = td.getTypicalTasks();%0A%0A        TestEvent eventToAdd = te.assignment;%0A        commandBox.runCommand(eventToAdd.getAddCommand());%0A        assertUndoSuccess(currentList);%0A%0A        TestTask taskToAdd = td.travel;%0A        commandBox.runCommand(taskToAdd.getAddCommand());%0A        assertUndoSuccess(currentList);%0A    %7D%0A%0A    @Test%0A    public void undo_delete() %7B%0A        TestTask%5B%5D currentList = td.getTypicalTasks();%0A%0A        int targetIndex = 2;%0A        commandBox.runCommand(%22delete %22 + targetIndex);%0A        assertUndoSuccess(currentList);%0A%0A        targetIndex = 3;%0A        commandBox.runCommand(%22delete %22 + targetIndex);%0A        assertUndoSuccess(currentList);%0A    %7D%0A%0A    @Test%0A    public void undo_finish() %7B%0A        TestTask%5B%5D currentList = td.getTypicalTasks();%0A%0A        int targetIndex = 2;%0A        commandBox.runCommand(%22finish %22 + targetIndex);%0A        assertUndoSuccess(currentList);%0A%0A        targetIndex = 3;%0A        commandBox.runCommand(%22finish %22 + targetIndex);%0A        assertUndoSuccess(currentList);%0A    %7D%0A%0A    @Test%0A    public void undo_edit() %7B%0A        TestTask%5B%5D currentList = td.getTypicalTasks();%0A%0A        int targetIndex = 2;%0A        String detailsToEdit = %22 n/assignment2 dueT/18:30%22;%0A        commandBox.runCommand(%22edit %22 + targetIndex + detailsToEdit);%0A        assertUndoSuccess(currentList);%0A%0A        targetIndex = 4;%0A        detailsToEdit = %22 start/03/05/ due/08/05 *u p/important #school%22;%0A        commandBox.runCommand(%22edit %22 + targetIndex + detailsToEdit);%0A        assertUndoSuccess(currentList);%0A    %7D%0A%0A    private void assertUndoSuccess(final TestTask%5B%5D currentList) %7B%0A        commandBox.runCommand(%22undo%22);%0A        //confirm the list now contains all previous tasks%0A        assertTrue(taskListPanel.isListMatching(currentList));%0A        //confirm the result message is correct%0A        assertResultMessage(MESSAGE_SUCCESS);%0A    %7D
 %0A%7D%0A

Add undo command test