@@ -0,0 +1,1114 @@
+package guitests;%0A%0A//@@author A0125221Y%0Aimport static org.junit.Assert.assertTrue;%0A%0Aimport org.junit.Test;%0A%0Aimport seedu.address.testutil.TestTask;%0Aimport seedu.address.testutil.TestUtil;%0A%0Apublic class UndoCommandTest extends AddressBookGuiTest%7B%0A%0A%09@Test%0A%09public void undoWithOneModification_Success()%7B%0A%0A%09%09TestTask%5B%5D currentList = td.getTypicalTasks();%0A%0A%09%09//Begin by adding one task%0A%09%09TestTask taskToAdd = td.hoon;%0A%09%09commandBox.runCommand(taskToAdd.getAddCommand());%0A%09%09assertListSize(currentList.length + 1);%0A%0A%09%09//Next undo the previous add command%0A%09%09commandBox.runCommand(%22undo%22);%0A%09%09assertListSize(currentList.length);%0A%09%09assertTrue(taskListPanel.isListMatching(currentList));%0A%0A%09%09//Now test deletion of one single task%0A%09%09commandBox.runCommand(%22delete 1%22);%0A%09%09assertListSize(currentList.length - 1);%0A%09%09currentList = TestUtil.removeTaskFromList(currentList, 1);%0A%0A%09%09//Try to undo the previous delete command%0A%09%09commandBox.runCommand(%22undo%22);%0A%09%09currentList = TestUtil.addTasksToListAtIndex(currentList, 0, td.alice);%0A%09%09assertListSize(currentList.length);%0A%09%09assertTrue(taskListPanel.isListMatching(currentList));%0A%0A%09%7D%0A%0A%0A%0A%7D%0A

Test cases for Undo Command