//@@author A0105748B
package guitests;

import static org.junit.Assert.assertTrue;

import org.junit.Test;

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

public class ShowCommandTest extends TodoListGuiTest {

    @Test
    public void showNonEmptyList() {
        assertShowResult("show finished"); // no results
        assertShowResult("show done", td.buymilk, td.creatework, td.eatleftovers); // multiple results
        assertShowResult("show undone", td.assignment, td.dumpmilk, td.findsocks, td.getclothes); //multiple results

        //find after deleting one result
        commandBox.runCommand("delete 1");
        assertShowResult("show done", td.buymilk, td.creatework, td.eatleftovers);
        assertShowResult("show undone", td.dumpmilk, td.findsocks, td.getclothes);
    }

    @Test
    public void showEmptyList() {
        commandBox.runCommand("clear");
        assertShowResult("show done"); // no results
    }

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

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

@@ -75,16 +75,104 @@
 ertTrue;
+%0Aimport static seedu.bulletjournal.commons.core.Messages.MESSAGE_INVALID_COMMAND_FORMAT;
 %0A%0Aimport
@@ -239,16 +239,71 @@
 ssages;%0A
+import seedu.bulletjournal.logic.commands.ShowCommand;%0A
 import s
@@ -399,32 +399,32 @@
 st %7B%0A%0A    @Test%0A
+
     public void 
@@ -448,65 +448,8 @@
 ) %7B%0A
-        assertShowResult(%22show finished%22); // no results%0A
     
@@ -1225,16 +1225,186 @@
 MMAND);%0A
+        commandBox.runCommand(%22show finished%22); // invalid command%0A        assertResultMessage(String.format(MESSAGE_INVALID_COMMAND_FORMAT, ShowCommand.MESSAGE_USAGE));%0A
     %7D%0A%0A 

Fix unit test for show command