public void ShouldGetTheThirdFreeAndNotFreeShipping() { // ARRANGE var productA = new Product {Price = 1.28m, Name = "Widget"}; var productB = new Product {Price = 2.56m, Name = "Do Hickey"}; var cart = new ShoppingCart { Products = new List<Product> {productA, productB, productA, productB, productA} }; var sut = new RulesEngineImpleamentation(cart); // ACT ShoppingCart result = sut.Run(); // ASSERT const decimal expectedTotal = 7.68m; result.FreeShippng.Should().BeFalse(); result.TotalValue.Should().Be(expectedTotal); }
public RulesEngineImpleamentation(ShoppingCart shoppingCart) { _shoppingCart = shoppingCart; }