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.7][F11-3]Cai Jiaxiu #444

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

Conversation

jiaxiu11
Copy link

No description provided.

@chikchengyao
Copy link

Nice work! But would be best to add test coverage as well.

Copy link

@jelneo jelneo left a comment

Choose a reason for hiding this comment

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

Good job. It is encouraged to update user guide if you have not done so. Please close this PR after reading my comments

@@ -61,7 +61,7 @@ public Address getAddress() {
public Set<Tag> getTags() {
return new HashSet<>(tags);
}

Copy link

Choose a reason for hiding this comment

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

Unnecessary space. Ensure that you look through the changes to the code before you stage a file for commit.

}

/**
* set the original and updated person
Copy link

Choose a reason for hiding this comment

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

Standardize header comments by ensuring all comments start with a capital letter.

setUpdatedPerson();
addressBook.updatePerson(original, toUpdate);
return new CommandResult(String.format(MESSAGE_UPDATE_PERSON_SUCCESS, toUpdate));

Copy link

Choose a reason for hiding this comment

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

unnecessary blank line

@@ -148,15 +162,56 @@ private static boolean isPrivatePrefixPresent(String matchedPrefix) {
*/
private static Set<String> getTagsFromArgs(String tagArguments) throws IllegalValueException {
// no tags
if (tagArguments.isEmpty()) {
if (tagArguments.isEmpty() || tagArguments.trim().isEmpty()) {
Copy link

Choose a reason for hiding this comment

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

This condition can be simplified to just tagArguments.trim().isEmpty() since trim() just removes leading and trailing whitespace in tagArguments

@@ -9,6 +9,9 @@
|| add: Adds a person to the address book. Contact details can be marked private by prepending 'p' to the prefix.
|| Parameters: NAME [p]p/PHONE [p]e/EMAIL [p]a/ADDRESS [t/TAG]...
|| Example: add John Doe p/98765432 e/[email protected] a/311, Clementi Ave 2, #02-25 t/friends t/owesMoney
|| update: Updates a person identified by the index number used in the last person listing.
|| Parameters: INDEX [[p]p/PHONE] [[p]e/EMAIL] [[p]a/ADDRESS] [t/TAG]...
Copy link

Choose a reason for hiding this comment

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

is there an extra [ before [p]?

@@ -294,6 +295,69 @@ private static String convertPersonToAddCommandString(ReadOnlyPerson person) {
return addCommand;
}

/*
* Tests for update person command ==============================================================================
Copy link

Choose a reason for hiding this comment

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

there's no need to write header comments for tests

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