@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); }
@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); }
@Test public void shouldReturn_130_whenListHasItem_A_A_A() { HashMap<Item, Integer> items = new HashMap<>(); items.put(A, 3); assertTrue(PriceCalculator.calculatePriceForItems(items) == 130); }
@Test public void shouldReturn_0_whenNoItems() { assertTrue(PriceCalculator.calculatePriceForItems(new HashMap<>()) == 0); }