diff --git a/src/test/java/seedu/address/logic/commands/ListNoteCommandTest.java b/src/test/java/seedu/address/logic/commands/ListNoteCommandTest.java new file mode 100644 index 00000000000..7eef98ee8f2 --- /dev/null +++ b/src/test/java/seedu/address/logic/commands/ListNoteCommandTest.java @@ -0,0 +1,39 @@ +package seedu.address.logic.commands; + +import static seedu.address.logic.commands.CommandTestUtil.assertCommandSuccess; +import static seedu.address.logic.commands.CommandTestUtil.showNoteAtIndex; +import static seedu.address.testutil.TypicalIndexes.INDEX_FIRST_NOTE; +import static seedu.address.testutil.TypicalNotes.getTypicalAddressBook; + +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +import seedu.address.model.Model; +import seedu.address.model.ModelManager; +import seedu.address.model.UserPrefs; + +/** + * Contains integration tests (interaction with the Model) and unit tests for ListNoteCommand. + */ +public class ListNoteCommandTest { + + private Model model; + private Model expectedModel; + + @BeforeEach + public void setUp() { + model = new ModelManager(getTypicalAddressBook(), new UserPrefs()); + expectedModel = new ModelManager(model.getAddressBook(), new UserPrefs()); + } + + @Test + public void execute_listIsNotFiltered_showsSameList() { + assertCommandSuccess(new ListNoteCommand(), model, ListNoteCommand.MESSAGE_SUCCESS, expectedModel); + } + + @Test + public void execute_listIsFiltered_showsEverything() { + showNoteAtIndex(model, INDEX_FIRST_NOTE); + assertCommandSuccess(new ListNoteCommand(), model, ListNoteCommand.MESSAGE_SUCCESS, expectedModel); + } +}