package guitests;

import org.junit.Test;
import seedu.address.commons.core.Messages;
import seedu.address.testutil.TestActivity;
import seedu.address.testutil.TypicalTestActivities;
import static org.junit.Assert.assertTrue;

public class UndoCommandTest extends AddressBookGuiTest {

    @Test
    public void undo_addCommand() {
        TestActivity[] currentList = td.getTypicalPersons();
        TestActivity activityToAdd = td.findHoon;
        assertUndoAddResult(activityToAdd,currentList);
        
    }
    
    private void assertUndoResult(String command,TestActivity... currentList){
        commandBox.runCommand(command);
        commandBox.runCommand("undo");
        assertTrue(personListPanel.isListMatching(currentList));
        
    }
    
    private void assertUndoAddResult(TestActivity activity,TestActivity... currentList){
        commandBox.runCommand(activity.getAddCommand());
        commandBox.runCommand("undo");
        assertResultMessage(String.format("Undo: Adding of new task: %1$s",activity.getAsText()));
        assertTrue(activityListPanel.isListMatching(currentList));
        
    }
    
    
}

@@ -504,32 +504,521 @@
     %0A    %7D%0A    %0A
+    @Test%0A    public void undo_deleteCommand() %7B%0A        TestActivity%5B%5D currentList = td.getTypicalPersons();%0A        int Index = 2;%0A        TestActivity activityToDelete = currentList%5BIndex-1%5D ;%0A        %0A        commandBox.runCommand(%22delete %22 + Index);%0A        commandBox.runCommand(%22undo%22);%0A        assertResultMessage(String.format(%22Undo: Deleting task: %251$s%22,activityToDelete.getAsText()));%0A        assertTrue(activityListPanel.isListMatching(currentList));%0A         %0A    %7D%0A    %0A    %0A
     private void
@@ -1072,32 +1072,32 @@
 . currentList)%7B%0A
-
         commandB
@@ -1182,14 +1182,16 @@
 rue(
-person
+activity
 List

add Delete test in UndoCommandTest