/** Tests removing guides wich doesn't belong to the set. */ public void testRemoveEmpty() { DummyEmptyGuide guide = new DummyEmptyGuide(); guide.setTitle("1"); set.add(new DummyEmptyGuide()); set.remove(guide); assertEquals("Something was removed. It shouldn't.", 1, set.getGuidesCount()); }
/** Tests handling of errors during removal of guides. */ public void testRemoveFail() { try { set.remove(null); fail("Guide should be specified. NPE is expected."); } catch (NullPointerException e) { // Expected } }
/** Tests removing of the guides from the set. */ public void testRemove() { DummyEmptyGuide guide = new DummyEmptyGuide(); guide.setTitle("1"); set.add(guide); set.add(new DummyEmptyGuide()); set.remove(guide); assertEquals("Guide wasn't removed.", 1, set.getGuidesCount()); assertFalse("Wrong guide was removed.", guide == set.getGuideAt(0)); }
/** Tests working of the counter when adding and removing feeds. */ public void testGetGuidesCount() { assertEquals("Wrong initial count.", 0, set.getGuidesCount()); DummyEmptyGuide guide = new DummyEmptyGuide(); set.add(guide); assertEquals("Wrong count.", 1, set.getGuidesCount()); set.remove(guide); assertEquals("Wrong count.", 0, set.getGuidesCount()); }