package guitests;

import static org.junit.Assert.assertTrue;

import org.junit.Test;

public class ClearCommandTest extends TaskManagerGuiTest {

    @Test
    public void clear() {

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

        //verify other commands can work after a clear command
        commandBox.runCommand(td.hoon.getAddCommand());
        assertTrue(taskListPanel.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 all");
        assertListSize(0);
        assertResultMessage("Task Manager has been cleared!");
    }
}

@@ -332,16 +332,21 @@
 Success(
+%22all%22
 );%0A%0A    
@@ -684,16 +684,21 @@
 Success(
+%22all%22
 );%0A    %7D
@@ -699,16 +699,325 @@
 %0A    %7D%0A%0A
+    @Test%0A    public void clearDone() %7B%0A%0A        //prepare test%0A        commandBox.runCommand(%22mark 1%22);%0A        commandBox.runCommand(%22mark 2%22);%0A        commandBox.runCommand(%22mark 3%22);%0A%0A        //verify done tasks can be cleared%0A        assertClearCommandSuccess(%22done%22);%0A        assertListSize(4);%0A%0A    %7D%0A%0A
     priv
@@ -1051,16 +1051,32 @@
 Success(
+String parameter
 ) %7B%0A    
@@ -1112,41 +1112,151 @@
 ear 
-all%22);%0A        assertListSize(0);
+%22 + parameter);%0A        if (%22all%22.equals(parameter)) %7B%0A            assertListSize(0);%0A        %7D else %7B%0A            assertListSize(4);%0A        %7D
 %0A   

Modify clear command test