-
Notifications
You must be signed in to change notification settings - Fork 141
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
[W5.11r][W15-B3] Pham Vu Hung #775
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job on unit test coverage, take note of the comments on edit command.
And remember to submit on time in the future.
|
||
import seedu.addressbook.common.Messages; | ||
import seedu.addressbook.data.exception.IllegalValueException; | ||
import seedu.addressbook.data.person.*; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should avoid importing by *
public CommandResult execute() { | ||
try { | ||
final ReadOnlyPerson target = getTargetPerson(); | ||
toEdit.changeName(target.getName()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There shouldn't be a random setter() just to cater for editting.
); | ||
} | ||
|
||
public ReadOnlyPerson getPerson() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this really necessary?
tagSet.add(new Tag(tagName)); | ||
} | ||
this.toEdit = new Person( | ||
new Name("dummy"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could use the index to retrieve the name of toEdit
.
@@ -82,6 +82,19 @@ public void addPerson(Person toAdd) throws DuplicatePersonException { | |||
allPersons.add(toAdd); | |||
} | |||
|
|||
public void editPerson(ReadOnlyPerson target, Person editedPerson) throws PersonNotFoundException { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Every public facing method should have a method header according to JavaDoc standards.
* | ||
* @param newName | ||
*/ | ||
public void changeName(Name newName) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should not be allowed.
} | ||
|
||
@Test | ||
public void execute_edit_invalidArgsFormat() throws Exception { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
your test names do not follow the convention specified in our coding guidelines.
please take note and name them appropriately in your project
@LeonidAgarth |
Added 2 enhancements: SortCommand and EditCommand
I sincerely apologize for submitting late