public void TestApplyDiscount() { IDiscounter target = getTestObject(); decimal total = 100M; var discountedTotal = target.ApplyDiscount(total); Assert.AreEqual(total * 0.8M, discountedTotal); }
public decimal ValueProducts(IEnumerable <Product> products) { return(m_discounter.ApplyDiscount(products.Sum(p => p.Price))); }