add test for removing nonJobActivity from TourActivities
@@ -22,6 +22,7 @@ import com.graphhopper.jsprit.core.problem.job.Service;
import com.graphhopper.jsprit.core.problem.job.Shipment;
import org.junit.Before;
import org.junit.Test;
+import org.mockito.Mockito;
import static org.junit.Assert.*;
@@ -118,6 +119,19 @@ public class TestTourActivities {
assertEquals(0, tour.getActivities().size());
}
+ @Test
+ public void removingNonJobActivityShouldWork() {
+ TourActivity nonJobAct = Mockito.mock(TourActivity.class);
+
+ tour.addActivity(nonJobAct);
+ assertTrue(tour.getActivities().contains(nonJobAct));
+
+ tour.removeActivity(nonJobAct);
+
+ assertTrue(tour.isEmpty());
+ assertFalse(tour.getActivities().contains(nonJobAct));
+ }
+
@Test
public void removingActivityShouldWork() {
tour.addActivity(act);
