diff --git a/src/main/java/seedu/address/logic/commands/ViewCommand.java b/src/main/java/seedu/address/logic/commands/ViewCommand.java index d182cb01fee..c8db00fa9f8 100644 --- a/src/main/java/seedu/address/logic/commands/ViewCommand.java +++ b/src/main/java/seedu/address/logic/commands/ViewCommand.java @@ -6,6 +6,7 @@ import java.util.List; import seedu.address.commons.core.index.Index; +import seedu.address.logic.Messages; import seedu.address.logic.commands.exceptions.CommandException; import seedu.address.model.Model; import seedu.address.model.client.Client; @@ -57,7 +58,7 @@ public CommandResult execute(Model model) throws CommandException { } Client clientToView = lastShownList.get(targetIndex.getZeroBased()); - return new CommandResult(String.format(MESSAGE_VIEW_CLIENT_SUCCESS, clientToView), + return new CommandResult(String.format(MESSAGE_VIEW_CLIENT_SUCCESS, Messages.format(clientToView)), false, false, true, clientToView, false, null, false); } diff --git a/src/test/java/seedu/address/logic/commands/ViewCommandTest.java b/src/test/java/seedu/address/logic/commands/ViewCommandTest.java index 6c1c343c262..a00add9963a 100644 --- a/src/test/java/seedu/address/logic/commands/ViewCommandTest.java +++ b/src/test/java/seedu/address/logic/commands/ViewCommandTest.java @@ -11,6 +11,7 @@ import org.junit.jupiter.api.Test; import seedu.address.commons.core.index.Index; +import seedu.address.logic.Messages; import seedu.address.logic.commands.exceptions.CommandException; import seedu.address.model.Model; import seedu.address.model.ModelManager; @@ -31,7 +32,7 @@ public void execute_validIndexUnfilteredList_success() throws Exception { Client clientToView = model.getFilteredClientList().get(INDEX_FIRST_CLIENT.getZeroBased()); ViewCommand viewCommand = new ViewCommand(INDEX_FIRST_CLIENT); - String expectedMessage = String.format(ViewCommand.MESSAGE_VIEW_CLIENT_SUCCESS, clientToView); + String expectedMessage = String.format(ViewCommand.MESSAGE_VIEW_CLIENT_SUCCESS, Messages.format(clientToView)); CommandResult result = viewCommand.execute(model);