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 38"); // no results
        assertFindResult("find 3", td.task3); // multiple results

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

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

    @Test
    public void find_invalidCommand_fail() {
        commandBox.runCommand("findsomething");
        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));
    }
}

@@ -54,16 +54,98 @@
 ertTrue;
+%0Aimport static seedu.address.commons.core.Messages.MESSAGE_INVALID_COMMAND_FORMAT;
 %0A%0Aimport
@@ -206,16 +206,65 @@
 ssages;%0A
+import seedu.address.logic.commands.FindCommand;%0A
 import s
@@ -642,24 +642,702 @@
 d 3%22);%0A    %7D
+%0A    %0A    @Test%0A    public void find_nonEmptyListLabel() %7B%0A        assertFindResult(%22find owesMoney%22, td.task2); // find only 1 label%0A    %7D%0A    %0A    @Test%0A    public void find_nonEmptyListMultipleLabel() %7B%0A        assertFindResult(%22find owesMoney friends%22, td.task1, td.task2); //find 2 label%0A    %7D%0A    %0A    @Test%0A    public void find_nonEmptyListStartEndDate_singleResult() %7B%0A        assertFindResult(%22find from today 11-11-2017 0000%22, td.task6); // 1 result%0A    %7D%0A    %0A    @Test%0A    public void find_nonEmptyListStartEndDate_pass() %7B%0A        assertFindResult(%22find from today christmas%22, td.task1, td.task2, td.task3, td.task4, td.task5, td.task6, td.task7); // 7 result%0A    %7D
 %0A%0A    @Test%0A
@@ -1640,24 +1640,254 @@
 MAND);%0A    %7D
+%0A    %0A    @Test%0A    public void find_validCommandNoInput_fail() %7B%0A        commandBox.runCommand(%22find%22); // no input here%0A        assertResultMessage(String.format(MESSAGE_INVALID_COMMAND_FORMAT, FindCommand.MESSAGE_USAGE));%0A    %7D
 %0A%0A    privat

Add more test cases to find command jUnit test to test on the nlp date parser