assertEquals(4, aManager.countValid(ass));
}
@Test
public void testAssignEvents() {
Assignment event1 = newAssignment(0, 1);
assertNotNull(aManager.assign(event1));
assertEquals(loc1, event1.getLocation());
assertEquals(1, aManager.getAll().size());
Feature loc1Feature = newFeature("special");
loc1.addFeature(loc1Feature);
Location locForEvent1 = newLocation("loc2", 5);
allLocations.add(locForEvent1);
aManager = new AssignmentManager(0, allLocations);
aManager.setAlgorithm(new HungarianAlgorithm());
Assignment event2 = newAssignment(0, 1);
event2.getEvent().addFeature(loc1Feature);
assertNotNull(aManager.assign(event1));
assertEquals(1, aManager.getAll().size());
assertEquals(loc1, event1.getLocation());
assertNotNull(aManager.assign(event2));
assertEquals(2, aManager.getAll().size());
assertEquals(loc1, event2.getLocation());
assertEquals(locForEvent1, event1.getLocation());
}