@Test public void itemSetChangeListeners_table_shouldFire() throws SQLException { ItemSetChangeListener listener = EasyMock.createMock(ItemSetChangeListener.class); listener.containerItemSetChange(EasyMock.isA(ItemSetChangeEvent.class)); EasyMock.replay(listener); container.addListener(listener); container.addItem(); EasyMock.verify(listener); }
@Test public void removeListener_table_shouldNotFire() throws SQLException { ItemSetChangeListener listener = EasyMock.createMock(ItemSetChangeListener.class); EasyMock.replay(listener); container.addListener(listener); container.removeListener(listener); container.addItem(); EasyMock.verify(listener); }
@Test public void itemSetChangeListeners_tableItemRemoved_shouldFire() throws SQLException { ItemSetChangeListener listener = EasyMock.createMock(ItemSetChangeListener.class); listener.containerItemSetChange(EasyMock.isA(ItemSetChangeEvent.class)); EasyMock.expectLastCall().anyTimes(); EasyMock.replay(listener); container.addListener(listener); container.removeItem(container.lastItemId()); EasyMock.verify(listener); }