-
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][T09-B3] Kang Anmin #730
base: master
Are you sure you want to change the base?
Conversation
… These are modifications in running code.
Changes the phone number of the 2nd person in the address book to 99997777. | ||
* `find Betsy`<br> | ||
`changenum 1 88886666`<br> | ||
Changes the phone number of the 1st person in the results of the `find` command to 88886666. |
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 for updating the UserGuide.
|
||
|
||
/** | ||
* Changes the phone number of a person identified using it's last displayed index from the address book. |
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 for writing the header comment.
@@ -13,6 +13,7 @@ | |||
|
|||
public static final String MESSAGE_ALL_USAGES = AddCommand.MESSAGE_USAGE | |||
+ "\n" + DeleteCommand.MESSAGE_USAGE | |||
+ "\n" + ChangeNumCommand.MESSAGE_USAGE |
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 for updating the help command.
@@ -66,6 +66,13 @@ public void setTags(UniqueTagList replacement) { | |||
tags.setTags(replacement); | |||
} | |||
|
|||
/** | |||
* Updates the person's phone number to the one in the argument. |
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.
For set and get methods, it's okay to remove the header comment.
@@ -12,7 +12,7 @@ | |||
public static final String MESSAGE_PHONE_CONSTRAINTS = "Person phone numbers should only contain numbers"; | |||
public static final String PHONE_VALIDATION_REGEX = "\\d+"; | |||
|
|||
public final String value; | |||
public String value; |
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.
Can it be private?
* @param str a string | ||
*/ | ||
private void checkIsPureDigitString (String str) throws IllegalValueException { | ||
if (!str.matches("[0-9]+")) { |
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 for validating the string.
} | ||
|
||
@Test | ||
public void execute_changenum_invalid_index() 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.
Coding standard violation for the method name..
} | ||
|
||
@Test | ||
public void execute_changenum_changesSuccessfully() 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.
Good job for testing the new command.
@EdwardKSG Some comments added. Please close the PR after reading comments. |
Makeup enhancement. Add changenum command to update the phone number of seclected person. UserGuide and tests have been modified accordingly.