Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Standardize EditClientCommand error msgs #318

Merged
merged 1 commit into from
Nov 7, 2022

Conversation

Thing1Thing2
Copy link

No description provided.

@Thing1Thing2 Thing1Thing2 added this to the v1.4 milestone Nov 5, 2022
@codecov-commenter
Copy link

Codecov Report

Base: 63.26% // Head: 63.17% // Decreases project coverage by -0.08% ⚠️

Coverage data is based on head (fa8f3c2) compared to base (a0017c0).
Patch coverage: 85.71% of modified lines in pull request are covered.

Additional details and impacted files
@@             Coverage Diff              @@
##             master     #318      +/-   ##
============================================
- Coverage     63.26%   63.17%   -0.09%     
  Complexity      650      650              
============================================
  Files           112      112              
  Lines          2273     2273              
  Branches        266      268       +2     
============================================
- Hits           1438     1436       -2     
- Misses          736      737       +1     
- Partials         99      100       +1     
Impacted Files Coverage Δ
.../address/logic/parser/EditClientCommandParser.java 77.41% <75.00%> (-4.40%) ⬇️
...eedu/address/logic/commands/EditClientCommand.java 86.86% <100.00%> (-0.77%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@@ -82,7 +83,9 @@ public CommandResult execute(Model model) throws CommandException {
Client clientToEdit = lastShownList.get(index.getZeroBased());
Client editedClient = createEditedClient(clientToEdit, editClientDescriptor);

if (!clientToEdit.isSameClient(editedClient) && model.hasClient(editedClient)) {
if (clientToEdit.equals(editedClient)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good implementation of differentiating changes or no changes

// no field specified
assertParseFailure(parser, " i/1", EditClientCommand.MESSAGE_NOT_EDITED);
String expectedMessage = String.format(MESSAGE_INVALID_COMMAND_FORMAT, EditClientCommand.MESSAGE_USAGE);
assertParseFailure(parser, VALID_NAME_AMY, expectedMessage);

// no index and no field specified
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just a sidenote, in keeping with the heuristic to test one at a time, you might want to separate this

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

okk

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants