public void ThrowsException_When_Price_Less_Than_Zero() { //Arrange IDiscountCalculator calc = GetDiscounter(); //Act decimal finalPrice = calc.GetDiscountedValue(-10); }
public void Apply_Default_Discount_For_Amount_Of_100() { //Arrange IDiscountCalculator calc = GetDiscounter(); //Act decimal finalPrice = calc.GetDiscountedValue(100); //Assert Assert.AreEqual(80, finalPrice); }
public decimal GetTotalValueOfProducts(IEnumerable <Product> products) { decimal price = products.Select(o => o.Price).DefaultIfEmpty(0).Sum(o => o); return(price = _disc.GetDiscountedValue(price)); }