Пример #1
0
        public void CalculateDiscount_For_CampaigDiscountByAmount_Should_Work()
        {
            // Arrange
            CategoryBase category = new FirstCategory(1, "First");
            var          test     = new CampaignDiscountByAmount(1, "test", 1, category, 3);

            // Act
            test.CalculateDiscount(null);

            // Assert
            Assert.True(test._calculatedDiscountAmount == 0);
        }
Пример #2
0
        public void CalculateDiscount_For_CampaigDiscountByAmount_Should_Work_AndApply_Discount()
        {
            // Arrange
            CategoryBase category = new FirstCategory(1, "First");

            var products = new List <ProductBase>();

            products.Add(new FirstProduct(1, "test", 10, category));
            products.Add(new FirstProduct(1, "test", 10, category));
            products.Add(new FirstProduct(1, "test", 10, category));

            var test = new CampaignDiscountByAmount(1, "test", 5, category, 3);

            // Act
            test.CalculateDiscount(products);

            // Assert
            Assert.True(test._calculatedDiscountAmount == 15);
        }