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

org.eclipse.tips.core.TipTest.testEqualsObject() fails #140 #142

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions org.eclipse.tips.tests/src/org/eclipse/tips/core/TipTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,8 @@ public void testGetSubject() {
public void testEqualsObject() {
TestTip testTip = new TestTip(fProvider.getID(), HTML, SUBJECT_TIP);
TestTip testTipx = new TestTip(fProvider.getID(), HTML, SUBJECT_TIP);
assertNotNull(testTip);
assertEquals(testTip, testTip.equals(testTip));
assertFalse(testTip.equals(fTip));
assertTrue(testTip.equals(testTipx));
Copy link
Contributor

Choose a reason for hiding this comment

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

better use assertEquals/NotEquals with the right arguments

Copy link
Member

Choose a reason for hiding this comment

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

This is in a test specifically for "equals" method thus I believe it's better to call the method directly.

Copy link
Contributor

Choose a reason for hiding this comment

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

oh ok.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Invocation of .equals() is made intentionally - that's what the test is exactly developed for - to test equals() work on these objects, as far as I understand.

The duplicating extra testing work done in the following two lines:

assertNotEquals(fTip, testTip);
assertEquals(testTipx, testTip);

but this is not the goal, it's done more to prove the .equals() -like assertions in two previous lines.

assertNotEquals(fTip, testTip);
assertEquals(testTipx, testTip);

Expand Down