-
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -75,10 +75,13 @@ public void setUp() throws Exception { | |
|
||
@Rule | ||
public ExpectedException thrown = ExpectedException.none(); | ||
|
||
|
||
@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 commentThe 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. |
||
Person bobChaplin_confirmPerson = emptyAddressBook.getAllPersons().iterator().next(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This naming style (using |
||
assertTrue(bobChaplin.equals(bobChaplin_confirmPerson)); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why not make use of existing methods in the |
||
emptyAddressBook.addPerson(charlieDouglas); | ||
|
||
UniqueTagList expectedTagList = new UniqueTagList(tagMathematician, tagScientist); | ||
|
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.