public void BatchPriceCalculatedCorrectly(string productsString, decimal expectedTotalPrice) { var products = ProductHelper.GetProducts(productsString); var offer = new BreadAndButterOffer(); var result = offer.Process(products); Assert.Equal(expectedTotalPrice, result.lineItems.Sum(li => li.Price)); }
public void ReturnsLineItemsAndRemainingProductsForEachFullBatch(string productsString, int expectedLineItemsCount, int expectedRemaining) { var products = ProductHelper.GetProducts(productsString); var offer = new BreadAndButterOffer(); var result = offer.Process(products); Assert.Equal(expectedLineItemsCount, result.lineItems.Count()); Assert.Equal(expectedRemaining, result.remainingProducts.Count()); }