コード例 #1
0
 @Test
 public void shouldReturn_225_whenListHasItem_A_A_A_A_B_B() {
   HashMap<Item, Integer> items = new HashMap<>();
   items.put(A, 4);
   items.put(B, 2);
   assertTrue(PriceCalculator.calculatePriceForItems(items) == 225);
 }
コード例 #2
0
 @Test
 public void shouldReturn_0_whenNoNormalPriceSpecified() {
   PriceHolder.updatePrices(new HashMap<>(), getDiscountPrices());
   HashMap<Item, Integer> items = new HashMap<>();
   items.put(A, 1);
   assertTrue(PriceCalculator.calculatePriceForItems(items) == 0);
 }
コード例 #3
0
 @Test
 public void shouldReturn_130_whenListHasItem_A_A_A() {
   HashMap<Item, Integer> items = new HashMap<>();
   items.put(A, 3);
   assertTrue(PriceCalculator.calculatePriceForItems(items) == 130);
 }
コード例 #4
0
 @Test
 public void shouldReturn_0_whenNoItems() {
   assertTrue(PriceCalculator.calculatePriceForItems(new HashMap<>()) == 0);
 }