Example #1
0
        public void Total_Scan1ItemNoDiscount_ReturnsCorrectPrice()
        {
            Checkout checkout = new Checkout(this.ruleFactory.Load());
            checkout.Scan("A");

            checkout.Total().Should().Be(50);
        }
Example #2
0
        public void Total_DoNotScanAnything_Returns0()
        {
            Checkout checkout = new Checkout(this.ruleFactory.Load());
            checkout.Scan(string.Empty);

            checkout.Total().Should().Be(0);
        }
Example #3
0
        public void Total_ScanManyAllItemsWithDiscount_ReturnsCorrectPrice()
        {
            Checkout checkout = new Checkout(this.ruleFactory.Load());
            checkout.Scan("A");
            checkout.Scan("A");
            checkout.Scan("A");
            checkout.Scan("B");
            checkout.Scan("B");

            checkout.Total().Should().Be(175);
        }
Example #4
0
        public void Total_NoRules_Returns0()
        {
            Checkout checkout = new Checkout(null);

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