Exemple #1
0
        public void Should_return_zero_discount_if_there_is_no_coupon()
        {
            var productCategory = new Category("Electronic");
            var product         = new Product("Notebook", 100.0, productCategory);

            var sut = new Business.Domains.ShoppingCart();

            sut.AddItem(product, Quantity);

            var result = sut.GetCouponDiscount();

            result.Should().Be(default(double));
        }
Exemple #2
0
        public void Should_return_zero_discount_if_there_is_no_applicable_coupon()
        {
            var productCategory = new Category("Electronic");
            var product         = new Product("Notebook", 100.0, productCategory);

            var coupon = new Coupon(MinimumPurchaseAmount, AmountOfDiscount, DiscountType.Amount);

            var sut = new Business.Domains.ShoppingCart();

            sut.AddItem(product, Quantity);
            sut.ApplyCoupon(coupon);

            var result = sut.GetCouponDiscount();

            result.Should().Be(default(double));
        }