Skip to content

Commit

Permalink
Resolve all comments in PR
Browse files Browse the repository at this point in the history
  • Loading branch information
DanzaSeah committed Oct 24, 2024
1 parent 709aac1 commit 73cef60
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
/**
* Lists all tasks in the address book to the user.
*/
public class ListTaskCommand extends Command {
public class ListTasksCommand extends Command {

public static final String COMMAND_WORD = "list-task";
public static final String COMMAND_WORD = "list-tasks";

public static final String MESSAGE_SUCCESS = "Listed all tasks";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import seedu.address.logic.commands.ExitCommand;
import seedu.address.logic.commands.HelpCommand;
import seedu.address.logic.commands.ListCommand;
import seedu.address.logic.commands.ListTaskCommand;
import seedu.address.logic.commands.ListTasksCommand;
import seedu.address.logic.commands.TagCommand;
import seedu.address.logic.commands.UntagCommand;
import seedu.address.logic.commands.findcommand.FindCommand;
Expand Down Expand Up @@ -89,7 +89,7 @@ public Command parseCommand(String userInput) throws ParseException {
case AssignWeddingCommand.COMMAND_WORD -> new AssignWeddingCommandParser().parse(arguments);
case UnassignWeddingCommand.COMMAND_WORD -> new UnassignWeddingCommandParser().parse(arguments);
case CreateTaskCommand.COMMAND_WORD -> new CreateTaskCommandParser().parse(arguments);
case ListTaskCommand.COMMAND_WORD -> new ListTaskCommand();
case ListTasksCommand.COMMAND_WORD -> new ListTasksCommand();
case DeleteTaskCommand.COMMAND_WORD -> new DeleteTaskCommandParser().parse(arguments);
default -> {
logger.finer("This user input caused a ParseException: " + userInput);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
/**
* Contains integration tests (interaction with the Model) and unit tests for ListTaskCommand.
*/
public class ListTaskCommandTest {
public class ListTasksCommandTest {

private Model model;
private Model expectedModel;
Expand All @@ -28,14 +28,14 @@ public void setUp() {

@Test
public void execute_listIsNotFiltered_showsSameList() {
CommandResult actualCommandResult = new ListTaskCommand().execute(model);
assertCommandSuccess(new ListTaskCommand(), model, actualCommandResult, expectedModel);
CommandResult actualCommandResult = new ListTasksCommand().execute(model);
assertCommandSuccess(new ListTasksCommand(), model, actualCommandResult, expectedModel);
}

@Test
public void execute_listIsFiltered_showsEverything() {
showTaskAtIndex(model, INDEX_FIRST); // Filters the task list to show only the first task
CommandResult actualCommandResult = new ListTaskCommand().execute(model);
assertCommandSuccess(new ListTaskCommand(), model, actualCommandResult, expectedModel);
CommandResult actualCommandResult = new ListTasksCommand().execute(model);
assertCommandSuccess(new ListTasksCommand(), model, actualCommandResult, expectedModel);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import seedu.address.logic.commands.ExitCommand;
import seedu.address.logic.commands.HelpCommand;
import seedu.address.logic.commands.ListCommand;
import seedu.address.logic.commands.ListTaskCommand;
import seedu.address.logic.commands.ListTasksCommand;
import seedu.address.logic.commands.TagCommand;
import seedu.address.logic.commands.UntagCommand;
import seedu.address.logic.commands.findcommand.FindCommand;
Expand Down Expand Up @@ -202,8 +202,8 @@ public void parseCommand_listWeddings() throws Exception {

@Test
public void parseCommand_listTask() throws Exception {
assertTrue(parser.parseCommand(ListTaskCommand.COMMAND_WORD) instanceof ListTaskCommand);
assertTrue(parser.parseCommand(ListTaskCommand.COMMAND_WORD + " 3") instanceof ListTaskCommand);
assertTrue(parser.parseCommand(ListTasksCommand.COMMAND_WORD) instanceof ListTasksCommand);
assertTrue(parser.parseCommand(ListTasksCommand.COMMAND_WORD + " 3") instanceof ListTasksCommand);
}

@Test
Expand Down
6 changes: 6 additions & 0 deletions src/test/java/seedu/address/model/task/DateTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,12 @@ public void equals_sameDate_returnsTrue() {
assertTrue(date1.equals(date2));
}

@Test
public void equals_self_returnsTrue() {
Date date1 = new Date(VALID_DATE);
assertTrue(date1.equals(date1));
}

@Test
public void equals_differentDate_returnsFalse() {
Date date1 = new Date(VALID_DATE);
Expand Down

0 comments on commit 73cef60

Please sign in to comment.