|
|
@ -28,4 +28,22 @@ public class WarehouseTest extends TestCase { |
|
|
|
// Then |
|
|
|
assertEquals(expectedTitel, gotItem.getTitel()); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void test_growingCountOfItemsInWarehouse() { |
|
|
|
// Given |
|
|
|
Warehouse warehouse = new Warehouse(); |
|
|
|
int unitsPerItemType = 3; |
|
|
|
int expectedSize = 13; |
|
|
|
for(int i = 0; i < expectedSize; i++) { |
|
|
|
Item item = new Item("ItemDummy" + i, "DescriptionDummy" + i, unitsPerItemType, 12.0f); |
|
|
|
warehouse.insertItem(item); |
|
|
|
} |
|
|
|
int expectedSum = expectedSize * unitsPerItemType; |
|
|
|
int actualSumOfAllItems = warehouse.getCountOfStock(); |
|
|
|
|
|
|
|
// Then |
|
|
|
assertEquals(expectedSum, actualSumOfAllItems); |
|
|
|
|
|
|
|
} |
|
|
|
} |