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

[W7][T11-1]Windrich #37

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

Conversation

windrichie
Copy link

Added enhancement to addressbook-level3

Copy link

@stephlewyh stephlewyh left a comment

Choose a reason for hiding this comment

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

Hi Windrich,

Good effort here!

(1) The enhancement logic works out well -e.g. preparing the person object at the constructor, to be added later.
(2) Good practice in updating the documentation.
(3) Provided adequate JUnit tests, with proper valid test inputs and assertions.

One thing you could be more aware of - header comments should be included in your code. Refer to the coding conventions guidelines.

You may close this PR after reviewing this comment.

+ "Example: " + COMMAND_WORD
+ " John Doe p/98765432 e/[email protected] a/311, Clementi Ave 2, #02-25 t/friends t/owesMoney";

// public static final String MESSAGE_SUCCESS = "New person added: %1$s";

Choose a reason for hiding this comment

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

Avoid leaving behind commented out code for submission.

return toAdd;
}

@Override

Choose a reason for hiding this comment

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

Missing header comment. All non-trivial methods should have java doc format header comments.

@@ -119,6 +122,33 @@ private Command prepareAdd(String args){
}
}

private Command prepareAddList(String args) {

Choose a reason for hiding this comment

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

Missing header comment. All non-trivial methods should have java doc format header comments.

@@ -245,6 +245,73 @@ public void addCommand_duplicateTags_merged() throws IllegalValueException {
assertEquals(result.getPerson(), testPerson);
}

@Test

Choose a reason for hiding this comment

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

Missing header comment. All non-trivial methods should have java doc format header comments.

parseAndAssertIncorrectWithMessage(resultMessage, inputs);
}

@Test

Choose a reason for hiding this comment

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

Missing header comment. All non-trivial methods should have java doc format header comments.

assertEquals(result.getPerson(), testPerson);
}

@Test

Choose a reason for hiding this comment

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

Missing header comment. All non-trivial methods should have java doc format header comments.

input += " t/" + tag.tagName;
}

final AddListCommand result = parseAndAssertCommandType(input, AddListCommand.class);

Choose a reason for hiding this comment

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

Missing header comment. All non-trivial methods should have java doc format header comments.

@@ -271,6 +338,18 @@ private static String convertPersonToAddCommandString(ReadOnlyPerson person) {
return addCommand;
}

private static String convertPersonToAddListCommandString(ReadOnlyPerson person) {

Choose a reason for hiding this comment

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

Missing header comment. All non-trivial methods should have java doc format header comments.


/*
Add a person to the addressbook and list down everyone in the addressbook right after
*/

Choose a reason for hiding this comment

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

You could have named the command as AddPersonCommand instead of AddListCommand. Add list may imply adding a list of things to something else, which is not what you are doing here.

addressBook.addPerson(toAdd);
List<ReadOnlyPerson> allPersons = addressBook.getAllPersons().immutableListView();
return new CommandResult(getMessageForPersonListShownSummary(allPersons), allPersons);
// return new CommandResult(String.format(MESSAGE_SUCCESS, toAdd));

Choose a reason for hiding this comment

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

Again, avoid leaving behind commented out code for submission. This reduces code readability.

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.

3 participants