package guitests;

import org.junit.Test;
import seedu.address.commons.core.Messages;
import seedu.address.testutil.TestEntry;

import static org.junit.Assert.assertTrue;

public class FindCommandTest extends SchedulerGuiTest {

    @Test
    public void find_nonEmptyList() {
        assertFindResult("find Mark"); //no results
        assertFindResult("find test", td.bio, td.chem); //multiple results

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

    @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, TestEntry... expectedHits ) {
        commandBox.runCommand(command);
        assertListSize(expectedHits.length);
        assertResultMessage(expectedHits.length + " entrys listed!");
        assertTrue(entryListPanel.isListMatching(expectedHits));
    }
}

@@ -349,25 +349,25 @@
 esult(%22find 
-t
+T
 est%22, td.bio
@@ -367,20 +367,20 @@
  td.
-bio
+chem
 , td.
-chem
+bio
 ); /
@@ -517,17 +517,17 @@
 ind 
-t
+T
 est%22,td.
 chem
@@ -522,20 +522,19 @@
 est%22,td.
-chem
+bio
 );%0A    %7D

Fix failure coming from FindCommandTest.java