public void DiscountForEmptyCart() { var cart = CommonInstansesCreator.GetCart(); var discount = new CartDiscount(cart, 50); Assert.Equal(0, discount.GetCost()); }
public void DiscountWorks() { var cart = CommonInstansesCreator.GetCart(); var productRepository = CommonInstansesCreator.GetProductRepo(); var product = productRepository.FirstOrDefault(); cart.AddProduct(new CartItem { Count = 2, Product = product }); var discount = new CartDiscount(cart, 50); Assert.Equal(product.Cost, discount.GetCost()); }