package guitests;

import static org.junit.Assert.assertTrue;

import org.junit.Test;

import seedu.address.commons.core.Messages;
import seedu.address.testutil.TestTask;

public class FindCommandTest extends TaskManagerGuiTest {

    @Test
    public void find_nonEmptyList() {
        assertFindResult("find Mark"); // no results
        assertFindResult("find Meier", td.benson, td.daniel); // multiple results

        //find after deleting one result
        commandBox.runCommand("delete 1");
        assertFindResult("find Meier", td.daniel);
    }

    @Test
    public void find_emptyList() {
        commandBox.runCommand("clear");
        assertFindResult("find Jean"); // no results
    }

    @Test
    public void find_invalidCommand_fail() {
        commandBox.runCommand("findgeorge");
        assertResultMessage(Messages.MESSAGE_UNKNOWN_COMMAND);
    }

    private void assertFindResult(String command, TestTask... expectedHits) {
        commandBox.runCommand(command);
        assertListSize(expectedHits.length);
        assertResultMessage(expectedHits.length + " tasks listed!");
        assertTrue(taskListPanel.isListMatching(expectedHits));
    }
}

@@ -124,16 +124,65 @@
 ssages;%0A
+import seedu.address.logic.commands.EditCommand;%0A
 import s
@@ -213,16 +213,16 @@
 stTask;%0A
-
 %0Apublic 
@@ -537,24 +537,884 @@
 delete 1%22);%0A
+    public void find_byKeywords() %7B%0A        assertFindResult(%22find Meier%22, td.benson, td.daniel); // find by name, multiple results%0A        assertFindResult(%22find friends%22, td.alice, td.benson); // find by tags, multiple results%0A        assertFindResult(%22find find%22, td.alice, td.benson, td.fiona); // find by description, multiple results%0A%0A      // find after adding one task%0A        commandBox.runCommand(td.benson.getAddCommand());%0A        assertFindResult(%22find Meier%22, td.benson, td.daniel, td.benson);%0A%0A      //find after deleting one result%0A        commandBox.runCommand(%22delete 3%22);%0A        assertFindResult(%22find Meier%22, td.benson, td.daniel);%0A%0A        //find after editing one task%0A        int targetIndex = 2;%0A        String detailsToEdit = %22Bobby%22;%0A        commandBox.runCommand(EditCommand.COMMAND_WORD + %22 %22 + targetIndex + %22 %22 + detailsToEdit);%0A
         asse
@@ -1451,32 +1451,42 @@
 daniel);%0A    %7D%0A%0A
+    @Test%0A
     @Test%0A    pu

Add find by keywords test cases