Ejemplo n.º 1
0
 @Test
 public void whenAddingTwoCapDimension_nuOfDimsShouldBeTwo() {
   VehicleTypeImpl type =
       VehicleTypeImpl.Builder.newInstance("t")
           .addCapacityDimension(0, 2)
           .addCapacityDimension(1, 4)
           .build();
   assertEquals(2, type.getCapacityDimensions().getNuOfDimensions());
 }
Ejemplo n.º 2
0
 @Test
 public void whenAddingTwoCapDimension_dimValuesMustBeCorrect() {
   VehicleTypeImpl type =
       VehicleTypeImpl.Builder.newInstance("t")
           .addCapacityDimension(0, 2)
           .addCapacityDimension(1, 4)
           .build();
   assertEquals(2, type.getCapacityDimensions().get(0));
   assertEquals(4, type.getCapacityDimensions().get(1));
 }
Ejemplo n.º 3
0
 @Test
 public void whenBuildingTypeJustByCallingNewInstance_capMustBeCorrect() {
   VehicleTypeImpl type = VehicleTypeImpl.Builder.newInstance("foo").build();
   assertEquals(0, type.getCapacityDimensions().get(0));
 }
Ejemplo n.º 4
0
 @Test
 public void whenTypeIsBuiltWithoutSpecifyingCapacity_itShouldHvCapDimValOfZero() {
   VehicleTypeImpl type = VehicleTypeImpl.Builder.newInstance("t").build();
   assertEquals(0, type.getCapacityDimensions().get(0));
 }
Ejemplo n.º 5
0
 @Test
 public void whenTypeIsBuiltWithoutSpecifyingCapacity_itShouldHvCapWithOneDim() {
   VehicleTypeImpl type = VehicleTypeImpl.Builder.newInstance("t").build();
   assertEquals(1, type.getCapacityDimensions().getNuOfDimensions());
 }