Esempio n. 1
0
        public decimal GetBasketTotal([FromBody] GetBasketTotalRequest totalRequest)
        {
            var basket = new Basket(
                totalRequest
                .SelectedProductsIdentifiers
                .Select(i => (ProductIdentifier)i));

            return(_basketCalculatorService.GetTotal(basket));
        }
Esempio n. 2
0
        public void GetTotal_TestsDifferentBasketsAndOffers_ReturnsTotalWithDiscounts(decimal expectedTotal, Basket basket)
        {
            var total = _calculatorService.GetTotal(basket);

            Assert.Equal(expectedTotal, total);
        }