Exemplo n.º 1
0
        public void Total_Scan3ItemsWithDiscount_ReturnsCorrectPrice()
        {
            Checkout checkout = new Checkout(this.ruleFactory.Load());
            checkout.Scan("A");
            checkout.Scan("A");
            checkout.Scan("A");

            checkout.Total().Should().Be(130);
        }
Exemplo n.º 2
0
        public void Total_DoNotScanAnything_Returns0()
        {
            Checkout checkout = new Checkout(this.ruleFactory.Load());
            checkout.Scan(string.Empty);

            checkout.Total().Should().Be(0);
        }
Exemplo n.º 3
0
        public void Total_ScanManyAllItemsWithOutDiscount_ReturnsCorrectPrice()
        {
            Checkout checkout = new Checkout(this.ruleFactory.Load());
            checkout.Scan("C");
            checkout.Scan("C");
            checkout.Scan("D");
            checkout.Scan("D");

            checkout.Total().Should().Be(70);
        }
Exemplo n.º 4
0
        public void Total_ScanManyItemNoDiscount_ReturnsCorrectPrice()
        {
            Checkout checkout = new Checkout(this.ruleFactory.Load());
            checkout.Scan("C");
            checkout.Scan("D");
            checkout.Scan("B");
            checkout.Scan("A");

            checkout.Total().Should().Be(115);
        }