コード例 #1
0
        public void Should_CalculateCorrectPriceForBasket(string basket, int totalPrice)
        {
            // Arrange
            var priceSystem = new PriceSystem();
            var checkout    = new Checkout(priceSystem);

            foreach (var i in basket)
            {
                checkout.Scan(i);
            }

            // Act
            var basketPrice = checkout.CalculatePrice();

            // Assert
            Assert.AreEqual(totalPrice, basketPrice);
        }