package guitests;

import static org.junit.Assert.assertTrue;

import org.junit.Test;

public class ClearCommandTest extends AddressBookGuiTest {

    @Test
    public void clear() {

        //verify a non-empty list can be cleared
        assertTrue(personListPanel.isListMatching(td.getTypicalPersons()));
        assertClearCommandSuccess();

        //verify other commands can work after a clear command
        commandBox.runCommand(td.hoon.getAddCommand());
        assertTrue(personListPanel.isListMatching(td.hoon));
        commandBox.runCommand("delete 1");
        assertListSize(0);

        //verify clear command works when the list is empty
        assertClearCommandSuccess();
    }

    private void assertClearCommandSuccess() {
        commandBox.runCommand("clear");
        assertListSize(0);
        assertResultMessage("Address book has been cleared!");
    }
}

@@ -336,16 +336,23 @@
 Success(
+%22clear%22
 );%0A%0A    
@@ -462,16 +462,22 @@
 Command(
+%22add %22
 ));%0A    
@@ -702,102 +702,1638 @@
 ess(
+%22clear%22
 );%0A
+%0A
     
-%7D%0A%0A    private void assertClearCommandSuccess() %7B%0A        commandBox.runCommand(%22clear%22
+    //verify other commands can work after a clear command%0A        commandBox.runCommand(td.hoon.getAddCommand(%22add %22));%0A        assertTrue(personListPanel.isListMatching(td.hoon));%0A        commandBox.runCommand(%22delete 1%22);%0A        assertListSize(0);%0A        assertClearCommandSuccess(%22clr%22);%0A%0A%0A        //verify other commands can work after a clear command%0A        commandBox.runCommand(td.hoon.getAddCommand(%22add %22));%0A        assertTrue(personListPanel.isListMatching(td.hoon));%0A        commandBox.runCommand(%22delete 1%22);%0A        assertListSize(0);%0A        assertClearCommandSuccess(%22c%22);%0A%0A        //verify other commands can work after a clear command%0A        commandBox.runCommand(td.hoon.getAddCommand(%22add %22));%0A        assertTrue(personListPanel.isListMatching(td.hoon));%0A        commandBox.runCommand(%22delete 1%22);%0A        assertListSize(0);%0A        assertClearCommandSuccess(%22clears%22);%0A%0A        //verify other commands can work after a clear command%0A        commandBox.runCommand(td.hoon.getAddCommand(%22add %22));%0A        assertTrue(personListPanel.isListMatching(td.hoon));%0A        commandBox.runCommand(%22delete 1%22);%0A        assertListSize(0);%0A        assertClearCommandSuccess(%22empty%22);%0A%0A%0A        //verify other commands can work after a clear command%0A        commandBox.runCommand(td.hoon.getAddCommand(%22add %22));%0A        assertTrue(personListPanel.isListMatching(td.hoon));%0A        commandBox.runCommand(%22delete 1%22);%0A        assertListSize(0);%0A        assertClearCommandSuccess(%22empties%22);%0A%0A    %7D%0A%0A    private void assertClearCommandSuccess(String clearCommand) %7B%0A        commandBox.runCommand(clearCommand
 );%0A 

Update ClearCommandTest