From f6f0d804e36a9356f5f063621a6894e3ed2db72b Mon Sep 17 00:00:00 2001 From: Jerryl Chong Date: Wed, 7 Oct 2020 00:40:54 +0800 Subject: [PATCH] Edit ListCommand to use new command and add back parseCommand_list test --- .../seedu/address/logic/commands/ListCommand.java | 2 +- .../address/logic/parser/AddressBookParserTest.java | 11 ++++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/main/java/seedu/address/logic/commands/ListCommand.java b/src/main/java/seedu/address/logic/commands/ListCommand.java index 84be6ad2596..02a84ef2fe8 100644 --- a/src/main/java/seedu/address/logic/commands/ListCommand.java +++ b/src/main/java/seedu/address/logic/commands/ListCommand.java @@ -10,7 +10,7 @@ */ public class ListCommand extends Command { - public static final String COMMAND_WORD = "list"; + public static final String COMMAND_WORD = "contact list"; public static final String MESSAGE_SUCCESS = "Listed all persons"; diff --git a/src/test/java/seedu/address/logic/parser/AddressBookParserTest.java b/src/test/java/seedu/address/logic/parser/AddressBookParserTest.java index 25584630eeb..651946a2a44 100644 --- a/src/test/java/seedu/address/logic/parser/AddressBookParserTest.java +++ b/src/test/java/seedu/address/logic/parser/AddressBookParserTest.java @@ -11,6 +11,7 @@ import seedu.address.logic.commands.AddCommand; import seedu.address.logic.commands.ExitCommand; import seedu.address.logic.commands.HelpCommand; +import seedu.address.logic.commands.ListCommand; import seedu.address.logic.parser.exceptions.ParseException; import seedu.address.model.person.Person; import seedu.address.testutil.PersonBuilder; @@ -69,11 +70,11 @@ public void parseCommand_help() throws Exception { assertTrue(parser.parseCommand(HelpCommand.COMMAND_WORD + " 3") instanceof HelpCommand); } - // @Test - // public void parseCommand_list() throws Exception { - // assertTrue(parser.parseCommand(ListCommand.COMMAND_WORD) instanceof ListCommand); - // assertTrue(parser.parseCommand(ListCommand.COMMAND_WORD + " 3") instanceof ListCommand); - // } + @Test + public void parseCommand_list() throws Exception { + assertTrue(parser.parseCommand(ListCommand.COMMAND_WORD) instanceof ListCommand); + assertTrue(parser.parseCommand(ListCommand.COMMAND_WORD + " 3") instanceof ListCommand); + } @Test public void parseCommand_unrecognisedInput_throwsParseException() {