Skip to content

Commit

Permalink
Update unit test for email checking
Browse files Browse the repository at this point in the history
  • Loading branch information
CYX22222003 committed Oct 10, 2024
1 parent 3dac918 commit 5ed3acc
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/test/java/seedu/address/model/person/PersonTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static seedu.address.logic.commands.CommandTestUtil.VALID_ADDRESS_BOB;
import static seedu.address.logic.commands.CommandTestUtil.VALID_EMAIL_AMY;
import static seedu.address.logic.commands.CommandTestUtil.VALID_EMAIL_BOB;
import static seedu.address.logic.commands.CommandTestUtil.VALID_NAME_BOB;
import static seedu.address.logic.commands.CommandTestUtil.VALID_PHONE_BOB;
Expand Down Expand Up @@ -51,6 +52,18 @@ public void isSamePerson() {
assertFalse(BOB.isSamePerson(editedBob));
}

@Test
public void hasSameEmail() {
assertTrue(ALICE.hasSameEmail(ALICE));

Person editedAlice = new PersonBuilder(ALICE).withEmail(VALID_EMAIL_BOB).build();
assertFalse(ALICE.hasSameEmail(editedAlice));

Person editedBob = new PersonBuilder(BOB).withEmail(VALID_EMAIL_AMY).build();
Person aliceWithNewEmail = new PersonBuilder(ALICE).withEmail(VALID_EMAIL_AMY).build();
assertTrue(aliceWithNewEmail.hasSameEmail(editedBob));
}

@Test
public void equals() {
// same values -> returns true
Expand Down

0 comments on commit 5ed3acc

Please sign in to comment.