@Test public void testRemoveProducer() throws Exception { Responsible toRemove = entity.getProducers().iterator().next(); producers.remove(toRemove); entity.removeProducer(toRemove); assertEquals(producers, entity.getProducers()); }
@Test public void testAddProducer() throws Exception { Responsible toAdd = RESPONSIBLE_FACTORY.getNext(); producers.add(toAdd); entity.addProducer(toAdd); assertEquals(producers, entity.getProducers()); }
@Before public void setUp() throws Exception { entity = FACTORY.getNext(); actors = entity.getActors(); producers = entity.getProducers(); directors = entity.getDirectors(); composers = entity.getComposers(); scenarists = entity.getScenarists(); otherStaffMembers = entity.getOtherStaffMembers(); }
@Test public void testAddAllProducers() throws Exception { Collection<Responsible> toAdd = new HashSet<>(); toAdd.add(RESPONSIBLE_FACTORY.getNext()); toAdd.add(RESPONSIBLE_FACTORY.getNext()); toAdd.add(RESPONSIBLE_FACTORY.getNext()); producers.addAll(toAdd); entity.addAllProducers(toAdd); assertEquals(producers, entity.getProducers()); }
@Test public void testRemoveAllProducers() throws Exception { Responsible base = RESPONSIBLE_FACTORY.getNext(); Responsible second = RESPONSIBLE_FACTORY.getNext(); Responsible third = RESPONSIBLE_FACTORY.getNext(); Collection<Responsible> toAdd = new HashSet<>(); toAdd.add(base); toAdd.add(second); toAdd.add(third); Collection<Responsible> toRemove = new HashSet<>(); toRemove.add(second); toRemove.add(third); producers.addAll(toAdd); entity.addAllProducers(toAdd); producers.removeAll(toRemove); entity.removeAllProducers(toRemove); assertEquals(producers, entity.getProducers()); }