Esempio n. 1
0
  @Test
  public void testRemoveRole() throws Exception {
    Role toRemove = entity.getActors().iterator().next();
    actors.remove(toRemove);
    entity.removeRole(toRemove.getRole());

    assertEquals(actors, entity.getActors());
  }
Esempio n. 2
0
 @Test
 public void testAddActor() throws Exception {
   Role toAdd = ROLE_FACTORY.getNext();
   actors.add(toAdd);
   entity.addActor(toAdd);
   assertEquals(actors, entity.getActors());
 }
Esempio n. 3
0
 @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();
 }
Esempio n. 4
0
  @Test
  public void testAddAllActors() throws Exception {
    Collection<Role> toAdd = new HashSet<>();
    toAdd.add(ROLE_FACTORY.getNext());
    toAdd.add(ROLE_FACTORY.getNext());
    toAdd.add(ROLE_FACTORY.getNext());

    actors.addAll(toAdd);
    entity.addAllActors(toAdd);
    assertEquals(actors, entity.getActors());
  }
Esempio n. 5
0
  @Test
  public void testRemoveAllActors() throws Exception {
    Role base = ROLE_FACTORY.getNext();
    Role second = ROLE_FACTORY.getNext();
    Role third = ROLE_FACTORY.getNext();

    Collection<Role> toAdd = new HashSet<>();
    toAdd.add(base);
    toAdd.add(second);
    toAdd.add(third);

    Collection<Role> toRemove = new HashSet<>();
    toRemove.add(second);
    toRemove.add(third);

    actors.addAll(toAdd);
    entity.addAllActors(toAdd);

    actors.removeAll(toRemove);
    entity.removeAllActors(toRemove);

    assertEquals(actors, entity.getActors());
  }