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 Task10"); // multiple results

        //find after deleting one result
        commandBox.runCommand("delete 1");
        assertFindResult("find Task10");
    }

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

@@ -360,19 +360,28 @@
 ind Task
-10%22
+4%22, td.task4
 ); // mu
@@ -519,10 +519,146 @@
 Task
-10
+7%22, td.task7);%0A%0A        //find task after deleting it%0A        commandBox.runCommand(%22delete 1%22);%0A        commandBox.runCommand(%22find Task7
 %22);%0A

Edit FindCommandTest