Skip to content

Commit

Permalink
Merge branch 'master' into update-UML-Diagram
Browse files Browse the repository at this point in the history
  • Loading branch information
Rachael-Chan committed Oct 23, 2024
2 parents c067484 + 0ed0cb3 commit 514074d
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public CommandResult execute(Model model) throws CommandException {
*/
private String generateSuccessMessage(Person personToEdit) {
String message = !remark.value.isEmpty() ? MESSAGE_ADD_REMARK_SUCCESS : MESSAGE_DELETE_REMARK_SUCCESS;
return String.format(message, personToEdit);
return String.format(message, Messages.format(personToEdit));
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ public RemarkCommand parse(String args) throws ParseException {
}

String remark = argMultimap.getValue(PREFIX_REMARK).orElse("");
System.out.println(remark);
return new RemarkCommand(index, new Remark(remark));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ public void execute_addRemarkUnfilteredList_success() {

RemarkCommand remarkCommand = new RemarkCommand(INDEX_FIRST_PERSON, new Remark(editedPerson.getRemark().value));

String expectedMessage = String.format(RemarkCommand.MESSAGE_ADD_REMARK_SUCCESS, editedPerson);
String expectedMessage = String.format(RemarkCommand.MESSAGE_ADD_REMARK_SUCCESS,
Messages.format(editedPerson));

Model expectedModel = new ModelManager(new AddressBook(model.getAddressBook()), new UserPrefs());
expectedModel.setPerson(firstPerson, editedPerson);
Expand All @@ -55,7 +56,8 @@ public void execute_deleteRemarkUnfilteredList_success() {
RemarkCommand remarkCommand = new RemarkCommand(INDEX_FIRST_PERSON,
new Remark(editedPerson.getRemark().toString()));

String expectedMessage = String.format(RemarkCommand.MESSAGE_DELETE_REMARK_SUCCESS, editedPerson);
String expectedMessage = String.format(RemarkCommand.MESSAGE_DELETE_REMARK_SUCCESS,
Messages.format(editedPerson));

Model expectedModel = new ModelManager(new AddressBook(model.getAddressBook()), new UserPrefs());
expectedModel.setPerson(firstPerson, editedPerson);
Expand All @@ -73,7 +75,7 @@ public void execute_filteredList_success() {

RemarkCommand remarkCommand = new RemarkCommand(INDEX_FIRST_PERSON, new Remark(editedPerson.getRemark().value));

String expectedMessage = String.format(RemarkCommand.MESSAGE_ADD_REMARK_SUCCESS, editedPerson);
String expectedMessage = String.format(RemarkCommand.MESSAGE_ADD_REMARK_SUCCESS, Messages.format(editedPerson));

Model expectedModel = new ModelManager(new AddressBook(model.getAddressBook()), new UserPrefs());
expectedModel.setPerson(firstPerson, editedPerson);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ public void toModelType_invalidPersonFile_discardInvalidPersonOnly() throws Exce
JsonSerializableAddressBook dataFromFile = JsonUtil
.readJsonFile(INVALID_PERSON_FILE, JsonSerializableAddressBook.class).get();
AddressBook addressBookFromFile = dataFromFile.toModelType();
System.out.println(addressBookFromFile.getPersonList());
Person validPerson = TypicalPersons.ALICE;
assertEquals(1, addressBookFromFile.getPersonList().size());
assertEquals(validPerson, addressBookFromFile.getPersonList().get(0));
Expand Down

0 comments on commit 514074d

Please sign in to comment.