public void ShouldReturnSpecialPriceOfItemWithSpecialPrice()
        {
            CheckoutMachine checkout = new CheckoutMachine("a: 1 2 for 1");

            checkout.Scan("a");
            checkout.Scan("a");
            Assert.AreEqual(checkout.Total, 1);
        }
        public void ShouldReturnNormalPriceOfASimpleItemScannedTwoTimes()
        {
            CheckoutMachine checkout = new CheckoutMachine("a: 1");

            checkout.Scan("a");
            checkout.Scan("a");
            Assert.AreEqual(checkout.Total, 2);
        }
        public void ShouldReturnCorrectPriceForMixedItems()
        {
            CheckoutMachine checkout = new CheckoutMachine(@"a: 2 2 for 1
b: 7
c: 4 3 for 10");

            checkout.Scan("a");
            checkout.Scan("b");
            checkout.Scan("c");
            checkout.Scan("c");
            checkout.Scan("c");
            Assert.AreEqual(checkout.Total, 19);
        }
Exemplo n.º 4
0
        public void ScanSingleItem()
        {
            checkoutMachine.Scan("C40");

            checkoutMachine.Done();

            Assert.AreEqual(checkoutMachine.TotalPrice, 60);
        }