1
0
Fork 0
mirror of https://github.com/graphhopper/jsprit.git synced 2020-01-24 07:45:05 +01:00

reproduce issue #213

This commit is contained in:
oblonski 2016-02-02 20:51:30 +01:00
parent 0e80c0ab50
commit 899fd78ad0

View file

@ -297,6 +297,17 @@ public class VehicleRoutingProblemTest {
return Location.Builder.newInstance().setId(i).build();
}
@Test(expected = IllegalStateException.class)
public void whenAddingVehiclesWithSameId_itShouldThrowException(){
VehicleRoutingProblem.Builder builder = VehicleRoutingProblem.Builder.newInstance();
VehicleType type = VehicleTypeImpl.Builder.newInstance("type").build();
VehicleImpl vehicle1 = VehicleImpl.Builder.newInstance("v").setStartLocation(Location.newInstance("loc")).setType(type).build();
VehicleImpl vehicle2 = VehicleImpl.Builder.newInstance("v").setStartLocation(Location.newInstance("loc")).setType(type).build();
builder.addVehicle(vehicle1);
builder.addVehicle(vehicle2);
}
@Test
public void whenAddingAVehicle_getAddedVehicleTypesShouldReturnItsType() {
VehicleRoutingProblem.Builder builder = VehicleRoutingProblem.Builder.newInstance();