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

[W5.11r][T09-B3] Kang Anmin #730

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

EdwardKSG
Copy link

Makeup enhancement. Add changenum command to update the phone number of seclected person. UserGuide and tests have been modified accordingly.

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.

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.

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

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.

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;

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]+")) {

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 {

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 {

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.

@jeffryhartanto
Copy link

@EdwardKSG Some comments added. Please close the PR after reading comments.

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

Successfully merging this pull request may close these issues.

4 participants