-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Unit tests in AddressBookTest needs improvement #182 #298
Unit tests in AddressBookTest needs improvement #182 #298
Conversation
@@ -75,10 +75,13 @@ public void setUp() throws Exception { | |||
|
|||
@Rule | |||
public ExpectedException thrown = ExpectedException.none(); | |||
|
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.
Avoid auto-formatting unrelated parts of the code. Doing so can result in unrelated changes being included in the commit. You can use sourcetree to look through changes before committing, and discard any unrelated changes. If you wish to commit formatting changes to unrelated parts of the code, do so in a separate commit.
|
||
@Test | ||
public void addPerson_emptyAddressBook() throws Exception { | ||
emptyAddressBook.addPerson(bobChaplin); | ||
emptyAddressBook.addPerson(bobChaplin); |
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.
Avoid auto-formatting unrelated parts of the code. Doing so can result in unrelated changes being included in the commit. You can use sourcetree to look through changes before committing, and discard any unrelated changes. If you wish to commit formatting changes to unrelated parts of the code, do so in a separate commit.
|
||
@Test | ||
public void addPerson_emptyAddressBook() throws Exception { | ||
emptyAddressBook.addPerson(bobChaplin); | ||
emptyAddressBook.addPerson(bobChaplin); | ||
Person bobChaplin_confirmPerson = emptyAddressBook.getAllPersons().iterator().next(); |
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.
This naming style (using _
in variables), is not consistent with the rest of the code base.
emptyAddressBook.addPerson(bobChaplin); | ||
emptyAddressBook.addPerson(bobChaplin); | ||
Person bobChaplin_confirmPerson = emptyAddressBook.getAllPersons().iterator().next(); | ||
assertTrue(bobChaplin.equals(bobChaplin_confirmPerson)); |
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.
Why not make use of existing methods in the AddressBook
class?
(Specifically AddressBook#containsPerson(ReadOnlyPerson):boolean
)
|
@PierceAndy Can you please review the PR for issue #182