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:
parent
bcfe9a401d
commit
21e4bb09f5
6 changed files with 15 additions and 3 deletions
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -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")
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue