public void GivenOneItemReturns8() { decimal calculatorPrices = DiscountService.CalculateCheapestPrice(_discounts, new List <int> { 1 }); Assert.AreEqual(new decimal(8.0), calculatorPrices); }
public void GivenOneSetOfItemsAndOneDuplicateReturnsOneSetPriceAndOneNormal() { decimal calculatorPrices = DiscountService.CalculateCheapestPrice(_discounts, new List <int> { 1, 2, 2 }); Assert.AreEqual(new decimal(23.2), calculatorPrices); }
public void FinalGoal() { decimal calculatorPrices = DiscountService.CalculateCheapestPrice(_discounts, new List <int> { 1, 1, 2, 2, 3, 3, 4, 5 }); Assert.AreEqual(new decimal(51.20), calculatorPrices); }
public void MakeSureDiscountsCanBeAppliedWhenDuplicatesAreAtTheStartOfTheProductList(int[] productList, decimal expectedPrice) { decimal calculatorPrices = DiscountService.CalculateCheapestPrice(_discounts, productList.ToList()); Assert.AreEqual(expectedPrice, calculatorPrices); }
public void GivenItemsReturnsExpectedPrice(int[] productList, decimal expectedPrice) { decimal calculatorPrices = DiscountService.CalculateCheapestPrice(_discounts, productList.ToList()); Assert.AreEqual(expectedPrice, calculatorPrices); }