package guitests;

import org.junit.Test;

import static org.junit.Assert.assertTrue;

public class ClearCommandTest extends TaskManagerGuiTest {

    @Test
    public void clear() {

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

        //verify other commands can work after a clear command
        commandBox.runCommand(td.deadline3.getAddCommand(false, false, false, false, false));
        assertTrue(itemListPanel.isListMatching(td.deadline3));
        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!");
    }
}

@@ -48,41 +48,303 @@
 rt s
-tatic org.junit.Assert.assertTrue
+eedu.taskmanager.logic.commands.ClearCommand;%0Aimport seedu.taskmanager.logic.commands.UndoCommand;%0A%0Aimport static org.junit.Assert.assertTrue;%0Aimport static seedu.taskmanager.logic.commands.ClearCommand.COMMAND_WORD;%0Aimport static seedu.taskmanager.logic.commands.ClearCommand.SHORT_COMMAND_WORD
 ;%0A%0Ap
@@ -594,16 +594,212 @@
 Success(
+COMMAND_WORD);%0A        commandBox.runCommand(UndoCommand.COMMAND_WORD);%0A        assertTrue(itemListPanel.isListMatching(td.getTypicalItems()));%0A        assertClearCommandSuccess(SHORT_COMMAND_WORD
 );%0A%0A    
@@ -1180,16 +1180,83 @@
 Success(
+COMMAND_WORD);%0A        assertClearCommandSuccess(SHORT_COMMAND_WORD
 );%0A    %7D
@@ -1300,16 +1300,34 @@
 Success(
+String commandWord
 ) %7B%0A    
@@ -1356,15 +1356,19 @@
 and(
-%22clear%22
+commandWord
 );%0A 
@@ -1425,40 +1425,36 @@
 age(
-%22Address book has been cleared!%22
+ClearCommand.MESSAGE_SUCCESS
 );%0A 

Update ClearCommandTest to cover SHORT_COMMAND_WORD