Skip to content

Commit

Permalink
Edit Tests
Browse files Browse the repository at this point in the history
  • Loading branch information
KJunWei committed Nov 7, 2022
1 parent 70f2552 commit ef202fa
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
10 changes: 10 additions & 0 deletions src/test/java/seedu/address/logic/commands/AddCommandTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,16 @@ public boolean hasPerson(Person person) {
throw new AssertionError("This method should not be called.");
}

@Override
public boolean hasEmail(Person person) {
throw new AssertionError("This method should not be called.");
}

@Override
public boolean hasPhone(Person person) {
throw new AssertionError("This method should not be called.");
}

@Override
public void deletePerson(Person target) {
throw new AssertionError("This method should not be called.");
Expand Down
13 changes: 4 additions & 9 deletions src/test/java/seedu/address/model/person/PersonTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,18 +36,13 @@ public void isSamePerson() {
.withAddress(VALID_ADDRESS_BOB).withTags(VALID_TAG_HUSBAND).build();
assertTrue(ALICE.isSamePerson(editedAlice));

// different name, all other attributes same -> returns true
// different name, all other attributes same -> returns false
editedAlice = new PersonBuilder(ALICE).withName(VALID_NAME_BOB).build();
assertTrue(ALICE.isSamePerson(editedAlice));
assertFalse(ALICE.isSamePerson(editedAlice));

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

// name has trailing spaces, all other attributes same -> returns true
String nameWithTrailingSpaces = VALID_NAME_BOB + " ";
editedBob = new PersonBuilder(BOB).withName(nameWithTrailingSpaces).build();
assertTrue(BOB.isSamePerson(editedBob));
assertFalse(BOB.isSamePerson(editedBob));
}

@Test
Expand Down

0 comments on commit ef202fa

Please sign in to comment.