From 7ea8bb1be9235478f69b7b3088875841410134ab Mon Sep 17 00:00:00 2001 From: raydenlim <109991591+raydenlim@users.noreply.github.com> Date: Thu, 2 Nov 2023 01:44:15 +0800 Subject: [PATCH] Fix return message bug --- .../seedu/address/logic/commands/EditGradedTestCommand.java | 3 ++- .../address/logic/commands/EditGradedTestCommandTest.java | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/main/java/seedu/address/logic/commands/EditGradedTestCommand.java b/src/main/java/seedu/address/logic/commands/EditGradedTestCommand.java index 6cde6488831..e450e5bac7c 100644 --- a/src/main/java/seedu/address/logic/commands/EditGradedTestCommand.java +++ b/src/main/java/seedu/address/logic/commands/EditGradedTestCommand.java @@ -105,7 +105,8 @@ public CommandResult execute(Model model) throws CommandException { model.setPerson(personToEdit, editedPerson); model.updateFilteredPersonList(PREDICATE_SHOW_ALL_PERSONS); - return new CommandResult(String.format(MESSAGE_EDIT_GRADEDTEST_SUCCESS, editedPerson), COMMAND_TYPE); + return new CommandResult(String.format(MESSAGE_EDIT_GRADEDTEST_SUCCESS, + Messages.format(editedPerson)), COMMAND_TYPE); } @Override diff --git a/src/test/java/seedu/address/logic/commands/EditGradedTestCommandTest.java b/src/test/java/seedu/address/logic/commands/EditGradedTestCommandTest.java index 48484b11d90..9362c64bf2f 100644 --- a/src/test/java/seedu/address/logic/commands/EditGradedTestCommandTest.java +++ b/src/test/java/seedu/address/logic/commands/EditGradedTestCommandTest.java @@ -59,7 +59,8 @@ public void execute_editGradedTest_success() { Person editedPerson = editGradedTestCommand.createEditedGradedTestPerson(personToEdit); // Define the expected message - String expectedMessage = String.format(EditGradedTestCommand.MESSAGE_EDIT_GRADEDTEST_SUCCESS, editedPerson); + String expectedMessage = String.format(EditGradedTestCommand.MESSAGE_EDIT_GRADEDTEST_SUCCESS, + Messages.format(editedPerson)); // Create a new model with the expected changes Model expectedModel = new ModelManager(new AddressBook(model.getAddressBook()), @@ -106,7 +107,8 @@ public void execute_editGradedTestDefaultValues_success() { Person editedPerson = editGradedTestCommand.createEditedGradedTestPerson(personToEdit); // Define the expected message - String expectedMessage = String.format(EditGradedTestCommand.MESSAGE_EDIT_GRADEDTEST_SUCCESS, editedPerson); + String expectedMessage = String.format(EditGradedTestCommand.MESSAGE_EDIT_GRADEDTEST_SUCCESS, + Messages.format(editedPerson)); // Create a new model with the expected changes Model expectedModel = new ModelManager(new AddressBook(model.getAddressBook()),