Skip to content

Commit

Permalink
Add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
nixonwidjaja committed Nov 5, 2023
1 parent d716e14 commit eb43021
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/java/seedu/address/model/person/Phone.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
public class Phone {

public static final String MESSAGE_CONSTRAINTS =
"Phone numbers should only contain numbers (or start with + sign for international numbers), " +
"and it should be between 3 - 20 digits long";
"Phone numbers should only contain numbers (or start with + sign for international numbers), "
+ "and it should be between 3 - 20 digits long";
public static final String VALIDATION_REGEX = "\\d{3,}";
public final String value;

Expand Down
6 changes: 6 additions & 0 deletions src/test/java/seedu/address/model/person/PersonTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@ public void isSamePerson() {
editedAlice = new PersonBuilder(ALICE).withName(VALID_NAME_BOB).build();
assertFalse(ALICE.isSamePerson(editedAlice));

editedAlice = new PersonBuilder(ALICE).withDob("1000-01-01").build();
assertFalse(ALICE.isSamePerson(editedAlice));

editedAlice = new PersonBuilder(ALICE).withPhone("911").withEmail("[email protected]").build();
assertFalse(ALICE.isSamePerson(editedAlice));

// name differs in case, all other attributes same -> returns false
Person editedBob = new PersonBuilder(BOB).withName(VALID_NAME_BOB.toLowerCase()).build();
assertFalse(BOB.isSamePerson(editedBob));
Expand Down

0 comments on commit eb43021

Please sign in to comment.