From 97a0f141c484a47f95588ccd4356579443f5f0fb Mon Sep 17 00:00:00 2001 From: maze508 Date: Mon, 11 Mar 2024 22:25:35 +0800 Subject: [PATCH] Add Code Coverage for Equals for new Name and Tag Predicate --- .../NameAndTagContainsKeywordsPredicateTest.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/test/java/seedu/address/model/person/NameAndTagContainsKeywordsPredicateTest.java b/src/test/java/seedu/address/model/person/NameAndTagContainsKeywordsPredicateTest.java index 52b6b188422..af6caa2ab66 100644 --- a/src/test/java/seedu/address/model/person/NameAndTagContainsKeywordsPredicateTest.java +++ b/src/test/java/seedu/address/model/person/NameAndTagContainsKeywordsPredicateTest.java @@ -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