Skip to content

Commit

Permalink
Add Code Coverage for Equals for new Name and Tag Predicate
Browse files Browse the repository at this point in the history
  • Loading branch information
maze508 committed Mar 11, 2024
1 parent 06712e2 commit 97a0f14
Showing 1 changed file with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,22 @@ public void equals() {

// different person -> returns false
assertFalse(firstPredicate.equals(secondPredicate));

NameAndTagContainsKeywordsPredicate thirdPredicate =
new NameAndTagContainsKeywordsPredicate(Collections.emptyList(), Arrays.asList("firstTag"));
NameAndTagContainsKeywordsPredicate fourthPredicate =
new NameAndTagContainsKeywordsPredicate(Collections.emptyList(), Arrays.asList("secondTag"));

// Different tagKeywords should not be equal
assertFalse(thirdPredicate.equals(fourthPredicate));

NameAndTagContainsKeywordsPredicate fifthPredicate =
new NameAndTagContainsKeywordsPredicate(Arrays.asList("Jamus"), Collections.emptyList());
NameAndTagContainsKeywordsPredicate sixthPredicate =
new NameAndTagContainsKeywordsPredicate(Arrays.asList("Jamuses"), Collections.emptyList());

// Different tagKeywords should not be equal
assertFalse(fifthPredicate.equals(sixthPredicate));
}

@Test
Expand Down

0 comments on commit 97a0f14

Please sign in to comment.