示例#1
0
        public void MissingCart()
        {
            var cartId  = new CartId("missing-cart");
            var storage = new SpyStorage();

            App.ApplyDiscount(cartId, storage);

            Assert.Null(storage.Saved);
        }
示例#2
0
        public void NoDiscount()
        {
            var cartId  = new CartId("some-normal-cart");
            var storage = new SpyStorage();

            App.ApplyDiscount(cartId, storage);

            Assert.Null(storage.Saved);
        }
示例#3
0
        public void HappyPath()
        {
            var cartId  = new CartId("some-gold-cart");
            var storage = new SpyStorage();

            App.ApplyDiscount(cartId, storage);

            var expected = new Cart(new CartId("some-gold-cart"), new CustomerId("gold-customer"), new Amount(50));

            Assert.Equal(expected, storage.Saved);
        }