mirror of
https://github.com/graphhopper/jsprit.git
synced 2020-01-24 07:45:05 +01:00
test constraints
This commit is contained in:
parent
b28753108c
commit
8f23104fbe
1 changed files with 12 additions and 1 deletions
|
|
@ -17,8 +17,9 @@
|
||||||
package jsprit.core.problem;
|
package jsprit.core.problem;
|
||||||
|
|
||||||
import static org.junit.Assert.assertEquals;
|
import static org.junit.Assert.assertEquals;
|
||||||
import jsprit.core.problem.VehicleRoutingProblem;
|
import static org.mockito.Mockito.mock;
|
||||||
import jsprit.core.problem.VehicleRoutingProblem.FleetSize;
|
import jsprit.core.problem.VehicleRoutingProblem.FleetSize;
|
||||||
|
import jsprit.core.problem.constraint.Constraint;
|
||||||
import jsprit.core.problem.job.Job;
|
import jsprit.core.problem.job.Job;
|
||||||
import jsprit.core.problem.job.Shipment;
|
import jsprit.core.problem.job.Shipment;
|
||||||
import jsprit.core.problem.vehicle.Vehicle;
|
import jsprit.core.problem.vehicle.Vehicle;
|
||||||
|
|
@ -82,5 +83,15 @@ public class VehicleRoutingProblemBuilderTest {
|
||||||
assertEquals(s2,vrp.getJobs().get("s2"));
|
assertEquals(s2,vrp.getJobs().get("s2"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void whenConstraintsAdded_theyShouldAppearInConstraintCollection(){
|
||||||
|
Constraint c1 = mock(Constraint.class);
|
||||||
|
Constraint c2 = mock(Constraint.class);
|
||||||
|
VehicleRoutingProblem.Builder builder = VehicleRoutingProblem.Builder.newInstance();
|
||||||
|
builder.addConstraint(c1).addConstraint(c2);
|
||||||
|
VehicleRoutingProblem problem = builder.build();
|
||||||
|
assertEquals(2,problem.getConstraints().size());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue