package guitests;

import static org.junit.Assert.assertTrue;

import org.junit.Test;

import seedu.address.logic.commands.UndoCommand;
import seedu.address.testutil.TestTask;
import seedu.address.testutil.TestUtil;

public class UndoCommandTest extends TaskManagerGuiTest {

    private TestTask[] expectedList = td.getTypicalTasks();

    /**
     * Tries to undo an add command
     */
    @Test
    public void undoAdd() {
        TestTask taskToAdd = td.alice;
        commandBox.runCommand(taskToAdd.getAddCommand());
        assertUndoSuccess(expectedList);
    }

    private void assertUndoSuccess(TestTask[] expectedList) {
        commandBox.runCommand(UndoCommand.COMMAND_WORD);
        assertTrue(taskListPanel.isListMatching(expectedList));
        assertResultMessage(String.format(UndoCommand.MESSAGE_SUCCESS));

    }

}


@@ -194,25 +194,36 @@
 ess.
-testutil.TestUtil
+logic.commands.DeleteCommand
 ;%0A%0Ap
@@ -576,16 +576,268 @@
 %0A    %7D%0A%0A
+    /**%0A     * Tries to undo a delete command%0A     */%0A    @Test%0A    public void undoDelete() %7B%0A        int targetIndex = 1;%0A        commandBox.runCommand(DeleteCommand.COMMAND_WORD + %22 %22 + targetIndex);%0A%0A        assertUndoSuccess(expectedList);%0A    %7D%0A%0A
     priv

Add test case for undo delete command