Skip to content

Commit

Permalink
Merge pull request #202 from FionaQY/improve-view-output
Browse files Browse the repository at this point in the history
Fix information shown by ViewCommand
  • Loading branch information
FionaQY authored Nov 7, 2024
2 parents 851fffc + e2acd1b commit 337b266
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/main/java/seedu/address/logic/commands/ViewCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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);

Expand Down

0 comments on commit 337b266

Please sign in to comment.