forked from nus-cs2103-AY2324S1/tp
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
052ed29
commit 90c7eda
Showing
6 changed files
with
108 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
src/test/java/seedu/address/model/person/HasLeaveAnyMonthPredicateTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package seedu.address.model.person; | ||
|
||
import org.junit.jupiter.api.Test; | ||
import seedu.address.testutil.PersonBuilder; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertEquals; | ||
import static org.junit.jupiter.api.Assertions.assertFalse; | ||
import static org.junit.jupiter.api.Assertions.assertNotEquals; | ||
import static org.junit.jupiter.api.Assertions.assertTrue; | ||
|
||
class HasLeaveAnyMonthPredicateTest { | ||
|
||
@Test | ||
void test_hasLeaveAnyMonth_returnsTrue() { | ||
HasLeaveAnyMonthPredicate predicate1 = new HasLeaveAnyMonthPredicate(); | ||
assertTrue(predicate1.test(new PersonBuilder().withLeave("111001000011").build())); | ||
} | ||
|
||
@Test | ||
void test_hasLeaveAnyMonth_returnsFalse() { | ||
HasLeaveAnyMonthPredicate predicate1 = new HasLeaveAnyMonthPredicate(); | ||
assertFalse(predicate1.test(new PersonBuilder().withLeave("000000000000").build())); | ||
} | ||
|
||
@Test | ||
void testEquals() { | ||
HasLeaveAnyMonthPredicate predicate1 = new HasLeaveAnyMonthPredicate(); | ||
HasLeaveAnyMonthPredicate predicate2 = new HasLeaveAnyMonthPredicate(); | ||
|
||
assertEquals(predicate1, predicate1); | ||
assertEquals(predicate1, predicate2); | ||
assertNotEquals(predicate1, null); | ||
assertNotEquals(predicate1, 1); | ||
} | ||
} |
36 changes: 36 additions & 0 deletions
36
src/test/java/seedu/address/model/person/HasLeaveThisMonthPredicateTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package seedu.address.model.person; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertEquals; | ||
import static org.junit.jupiter.api.Assertions.assertFalse; | ||
import static org.junit.jupiter.api.Assertions.assertNotEquals; | ||
import static org.junit.jupiter.api.Assertions.assertTrue; | ||
|
||
import org.junit.jupiter.api.Test; | ||
import seedu.address.testutil.PersonBuilder; | ||
|
||
class HasLeaveThisMonthPredicateTest { | ||
|
||
@Test | ||
void test_hasLeaveThisMonth_returnsTrue() { | ||
HasLeaveThisMonthPredicate predicate1 = new HasLeaveThisMonthPredicate("1"); | ||
assertTrue(predicate1.test(new PersonBuilder().withLeave("111001000011").build())); | ||
} | ||
|
||
@Test | ||
void test_hasLeaveThisMonth_returnsFalse() { | ||
HasLeaveThisMonthPredicate predicate1 = new HasLeaveThisMonthPredicate("4"); | ||
assertFalse(predicate1.test(new PersonBuilder().withLeave("111001000011").build())); | ||
} | ||
|
||
@Test | ||
void testEquals() { | ||
HasLeaveThisMonthPredicate predicate1 = new HasLeaveThisMonthPredicate("1"); | ||
HasLeaveThisMonthPredicate predicate2 = new HasLeaveThisMonthPredicate("1"); | ||
HasLeaveThisMonthPredicate predicate3 = new HasLeaveThisMonthPredicate("12"); | ||
assertEquals(predicate1, predicate1); | ||
assertEquals(predicate1, predicate2); | ||
assertNotEquals(predicate1, predicate3); | ||
assertNotEquals(predicate1, null); | ||
assertNotEquals(predicate1, 1); | ||
} | ||
} |