@Test public void equalsDesriptionWithEqualText() throws Exception { description.setText("equalMe"); // $NON-NLS-1$ SimpleTextualDescription otherDescription = new SimpleTextualDescription(); otherDescription.setText("equalMe"); // $NON-NLS-1$ assertEquals(description, otherDescription); }
@Test public void hasSameHashCodeLikeOtherEmptyDescription() throws Exception { assertEquals(description.hashCode(), new SimpleTextualDescription().hashCode()); }
@Test public void doesNotEqualObject() throws Exception { assertFalse(description.equals(new Object())); }
@Test public void textChangeListenerCountIncreasesWithAddition() throws Exception { description.addTextChangedListener(createMockTextChangeListener()); assertEquals(1, description.getTextChangeListenerCount()); }
@Test public void noTextChangeListenersAreRegistered() throws Exception { assertEquals(0, description.getTextChangeListenerCount()); }