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

added non-negative restriction

This commit is contained in:
oblonski 2014-02-19 09:08:15 +01:00
parent bcfe9a401d
commit 21e4bb09f5
6 changed files with 15 additions and 3 deletions

View file

@ -60,7 +60,7 @@ public class ServiceTest {
assertTrue(serviceSet.isEmpty());
}
@Test(expected=IllegalStateException.class)
@Test(expected=IllegalArgumentException.class)
public void whenCapacityDimValueIsNegative_throwIllegalStateExpception(){
@SuppressWarnings("unused")
Service s = Service.Builder.newInstance("s").setLocationId("foo").addCapacityDimension(0, -10).build();

View file

@ -44,6 +44,12 @@ public class ShipmentTest {
Shipment one = Shipment.Builder.newInstance("s", -10).setPickupLocation("foo").setDeliveryLocation("foofoo").build();
}
@Test(expected=IllegalArgumentException.class)
public void whenShipmentIsBuiltWithNegativeDemand_itShouldThrowException_v2(){
@SuppressWarnings("unused")
Shipment one = Shipment.Builder.newInstance("s").addCapacityDimension(0, -10).setPickupLocation("foo").setDeliveryLocation("foofoo").build();
}
@Test(expected=IllegalArgumentException.class)
public void whenIdIsNull_itShouldThrowException(){
@SuppressWarnings("unused")

View file

@ -7,7 +7,7 @@ import org.junit.Test;
public class VehicleTypeImplTest {
@Test(expected=IllegalStateException.class)
@Test(expected=IllegalArgumentException.class)
public void whenTypeHasNegativeCapacityVal_throwIllegalStateExpception(){
@SuppressWarnings("unused")
VehicleTypeImpl type = VehicleTypeImpl.Builder.newInstance("t").addCapacityDimension(0,-10).build();