-
Notifications
You must be signed in to change notification settings - Fork 5
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
Update add command to include block and room #63
Update add command to include block and room #63
Conversation
Codecov Report
@@ Coverage Diff @@
## master #63 +/- ##
============================================
+ Coverage 69.45% 69.85% +0.40%
- Complexity 431 441 +10
============================================
Files 77 79 +2
Lines 1401 1463 +62
Branches 146 151 +5
============================================
+ Hits 973 1022 +49
- Misses 387 397 +10
- Partials 41 44 +3
Continue to review full report at Codecov.
|
public Person(Name name, Phone phone, Email email, Address address, Set<Tag> tags) { | ||
requireAllNonNull(name, phone, email, address, tags); | ||
public Person(Name name, Phone phone, Email email, Address address, Set<Tag> tags, Block block, Room room) { | ||
requireAllNonNull(name, phone, email, address, tags, room); |
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.
How come block doesn't need to be non null?
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.
Looks good! Only minor changes needed.
+ MATRICULATION_NUMBER_DESC_BOB, | ||
String.format(MESSAGE_INVALID_COMMAND_FORMAT, AddCommand.MESSAGE_USAGE)); | ||
|
||
// invalid matriculation number | ||
assertParseFailure(parser, NAME_DESC_BOB + PHONE_DESC_BOB + EMAIL_DESC_BOB + ADDRESS_DESC_BOB | ||
+ GENDER_DESC_BOB + TAG_DESC_HUSBAND + TAG_DESC_FRIEND + INVALID_MATRICULATION_NUMBER_DESC, | ||
MatriculationNumber.MESSAGE_CONSTRAINTS); | ||
+ BLOCKROOM_DESC_BOB + GENDER_DESC_BOB + TAG_DESC_HUSBAND |
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.
Perhaps reducing the space by 4 would help conform to coding standards better.
|
||
// Manually added - Person's details found in {@code CommandTestUtil} | ||
public static final Person AMY = new PersonBuilder().withName(VALID_NAME_AMY).withPhone(VALID_PHONE_AMY) | ||
.withEmail(VALID_EMAIL_AMY).withAddress(VALID_ADDRESS_AMY).withTags(VALID_TAG_FRIEND) | ||
.withGender(VALID_GENDER_AMY) | ||
.withGender(VALID_GENDER_AMY).withBlock("A").withRoom("420") |
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.
Perhaps having VALID_BLOCK and VALID_ROOM will be better for conforming with standards
@@ -40,6 +41,7 @@ | |||
public static final String VALID_GENDER_BOB = "M"; | |||
public static final String VALID_TAG_HUSBAND = "husband"; | |||
public static final String VALID_TAG_FRIEND = "friend"; | |||
public static final String VALID_BLOCKROOM = "A420"; |
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.
perhaps you can split this up to VALID_BLOCK and VALID_ROOM, so that you can reuse them? (especially in TypicalPersons.java)
You can make VALID_BLOCKROOM with the 2 as well.
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.
Will update this
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.
Sorry I overlooked a few changes! I think this should be the last.
* Sets the {@code MatriculationNumber} of the {@code Person} that we are building. | ||
* Sets the {@code gender} of the {@code Person} that we are building. |
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.
I think got small typo here. Matriculation number and gender?
+ BLOCKROOM_DESC_BOB + TAG_DESC_HUSBAND + TAG_DESC_FRIEND | ||
+ MATRICULATION_NUMBER_DESC_BOB + GENDER_DESC_BOB, |
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.
assertParseSuccess(parser, NAME_DESC_BOB + PHONE_DESC_BOB + EMAIL_DESC_BOB + ADDRESS_DESC_BOB
+ BLOCKROOM_DESC_BOB + TAG_DESC_HUSBAND + TAG_DESC_FRIEND
+ MATRICULATION_NUMBER_DESC_BOB + GENDER_DESC_BOB,
Should the indentation be 8 spaces here? https://se-education.org/guides/conventions/java/intermediate.html#layout
+ BLOCKROOM_DESC_BOB + GENDER_DESC_BOB + TAG_DESC_FRIEND | ||
+ MATRICULATION_NUMBER_DESC_AMY + MATRICULATION_NUMBER_DESC_BOB, |
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.
assertParseSuccess(parser, NAME_DESC_BOB + PHONE_DESC_BOB + EMAIL_DESC_BOB + ADDRESS_DESC_BOB
+ BLOCKROOM_DESC_BOB + GENDER_DESC_BOB + TAG_DESC_FRIEND
+ MATRICULATION_NUMBER_DESC_AMY + MATRICULATION_NUMBER_DESC_BOB,
Should the indentation be 8 spaces here? https://se-education.org/guides/conventions/java/intermediate.html#layout
|
||
|
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.
I think it's better to remove this space?
@@ -57,6 +62,15 @@ public Address getAddress() { | |||
return address; | |||
} | |||
|
|||
|
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.
Same here, additional line can be removed.
No description provided.