Beispiel #1
0
        public void Gift_voucher_does_not_reduce_price_of_gift_voucher()
        {
            _target.Add(new LineItem(new GiftVoucher("ABC", 25m)));

            _target.Apply(new GiftVoucher("XXX", 10m));

            _target.Total.Should().Be(25m);
        }
Beispiel #2
0
        public void AnAIsFifty()
        {
            Event[] events =
            {
                new ItemScanned("A", 50)
            };

            var basket = new Basket();

            basket.Apply(events);

            Assert.Equal(50, basket.Total);
        }
Beispiel #3
0
        public void TwoAsAreOneHundred()
        {
            Event[] events =
            {
                new ItemScanned("A", 50),
                new ItemScanned("A", 50)
            };

            var basket = new Basket();

            basket.Apply(events);

            Assert.Equal(100, basket.Total);
        }
Beispiel #4
0
        public void ThreeAsAreOneTwenty()
        {
            Event[] events =
            {
                new ItemScanned("A", 50),
                new ItemScanned("A", 50),
                new ItemScanned("A", 50),
                new DiscountEarned(30)
            };

            var basket = new Basket();

            basket.Apply(events);

            Assert.Equal(120, basket.Total);
        }
 public void WhenIApply(GiftVoucher voucher)
 {
     _target.Apply(voucher);
 }