Пример #1
0
        public void ItShouldReturnTheCorrectCostOfTwoOranges()
        {
            var orange = new Orange();

            CheckoutCounter.Scan(orange);
            CheckoutCounter.Scan(orange);
            Assert.That(CheckoutCounter.Total(), Is.EqualTo(orange.GetCost() * 2));
        }
Пример #2
0
        public void ItShouldReturnCorrectPriceIf2OfTheSameItemIsScanned()
        {
            var orange = new Orange();

            CheckoutCounter.Scan(orange);
            CheckoutCounter.Scan(orange);
            Assert.That(CheckoutCounter.Total(), Is.EqualTo(orange.GetCost() * 2));
        }
Пример #3
0
        public void ItShouldReturnCorrectPriceFor2DifferentItemsAreScanned()
        {
            var apple  = new Apple();
            var orange = new Orange();

            CheckoutCounter.Scan(apple);
            CheckoutCounter.Scan(orange);
            Assert.That(CheckoutCounter.Total(), Is.EqualTo(apple.GetCost() + orange.GetCost()));
        }
Пример #4
0
        public void ItShouldReturnTheCorrectTotalForBananaTwoForAPoundDiscountWhenInDifferentOrder()
        {
            var banana = new Banana();
            var orange = new Orange();
            var apple  = new Apple();

            CheckoutCounter.Scan(banana);
            CheckoutCounter.Scan(orange);
            CheckoutCounter.Scan(banana);
            CheckoutCounter.Scan(apple);
            Assert.That(CheckoutCounter.Total(), Is.EqualTo(1.00M + orange.GetCost() + apple.GetCost()));
        }