package guitests;

import static org.junit.Assert.assertTrue;

import org.junit.Test;

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

public class FindCommandTest extends EzDoGuiTest {

    @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("kill 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));
    }
}

@@ -527,32 +527,347 @@
 daniel);%0A    %7D%0A%0A
+    @Test%0A    public void find_shortCommand() %7B%0A        assertFindResult(%22f Mark%22); // no results%0A        assertFindResult(%22f Meier%22, td.benson, td.daniel); // multiple results%0A%0A        //find after deleting one result%0A        commandBox.runCommand(%22kill 1%22);%0A        assertFindResult(%22f Meier%22, td.daniel);%0A    %7D%0A%0A
     @Test%0A    pu

Add test for shortened find command