Skip to content

Commit

Permalink
Merge pull request #161 from rayray39/branch-Find-Test
Browse files Browse the repository at this point in the history
Add positive test cases for find command testing
  • Loading branch information
AbdulrahmanAlRammah authored Oct 29, 2024
2 parents 0a0ae34 + 27a807a commit 2e2b557
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 2e2b557

Please sign in to comment.