Skip to content

Commit

Permalink
Add positive test cases when name and address contains prefixes
Browse files Browse the repository at this point in the history
  • Loading branch information
rayray39 committed Oct 29, 2024
1 parent 8b2d792 commit 27a807a
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,16 @@ public void parse_validArgs_returnsFindCommand() {
FindCommand expectedFindCommandForAddress =
new FindCommand(new AddressContainsKeywordsPredicate(Arrays.asList("Wall Street", "Michigan")));
assertParseSuccess(parser, " a/Wall Street_Michigan", expectedFindCommandForAddress);

// name contains 'n/' prefix
FindCommand expectedFindCommandNameContainsPrefix =
new FindCommand(new NameContainsKeywordsPredicate(Arrays.asList("n/Alice", "Bobn/")));
assertParseSuccess(parser, " n/n/Alice Bobn/", expectedFindCommandNameContainsPrefix);

// address contains 'a/' prefix
FindCommand expectedFindCommandAddressContainsPrefix =
new FindCommand(new AddressContainsKeywordsPredicate(Arrays.asList("Walla/ Street")));
assertParseSuccess(parser, " a/Walla/ Street", expectedFindCommandAddressContainsPrefix);
}

}

0 comments on commit 27a807a

Please sign in to comment.