Skip to content

Commit

Permalink
Add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tingxuanp committed Nov 4, 2024
1 parent 3e43268 commit da7ae20
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
import seedu.address.logic.commands.findcommand.FindNameCommand;
import seedu.address.logic.commands.findcommand.FindPhoneCommand;
import seedu.address.logic.commands.findcommand.FindTagCommand;
import seedu.address.logic.commands.findcommand.FindTaskCommand;
import seedu.address.logic.commands.findcommand.FindWeddingCommand;
import seedu.address.logic.commands.task.CreateTaskCommand;
import seedu.address.logic.commands.task.DeleteTaskCommand;
Expand All @@ -53,6 +54,7 @@
import seedu.address.model.person.keywordspredicate.NameContainsKeywordsPredicate;
import seedu.address.model.person.keywordspredicate.PhoneContainsKeywordsPredicate;
import seedu.address.model.person.keywordspredicate.TagContainsKeywordsPredicate;
import seedu.address.model.person.keywordspredicate.TaskContainsKeywordsPredicate;
import seedu.address.model.person.keywordspredicate.WeddingContainsKeywordsPredicate;
import seedu.address.model.tag.Tag;
import seedu.address.model.tag.TagName;
Expand Down Expand Up @@ -153,6 +155,14 @@ public void parseCommand_findWedding() throws Exception {
assertEquals(new FindWeddingCommand(new WeddingContainsKeywordsPredicate(keywords)), command);
}

@Test
public void findTask() throws Exception {
List<String> keywords = Arrays.asList("Order wedding cake");
FindTaskCommand command = (FindTaskCommand) parser.parseCommand(
FindCommand.COMMAND_WORD + " tk/" + keywords.stream().collect(Collectors.joining(" ")));
assertEquals(new FindTaskCommand(new TaskContainsKeywordsPredicate(keywords)), command);
}

@Test
public void parseCommand_help() throws Exception {
assertTrue(parser.parseCommand(HelpCommand.COMMAND_WORD) instanceof HelpCommand);
Expand Down

0 comments on commit da7ae20

Please sign in to comment.