Example #1
0
        public void GetRulesForCustomer_RuleNotMatched_ReturnsDefaultRule()
        {
            // Arrange
            dynamic param = new ExpandoObject();
            // Act
            var result = RuleMaker.MakeRule("Default", "promotions", param);

            // Assert
            Assert.AreEqual("Default", result.ProductName);
        }
Example #2
0
        public void GetRulesForCustomer_RuleForPriceDrop_ReturnpricedropRule()
        {
            // Arrange
            dynamic param = new ExpandoObject();

            param.droppedprice = 299.99;
            param.minnumitems  = 1;
            // Act
            var result = RuleMaker.MakeRule("Standout Ad", "price_drop", param);

            // Assert
            Assert.AreEqual("Standout Ad", result.ProductName);
        }
Example #3
0
        public void GetRulesForCustomer_RuleForDiscount_ReturnsDiscountRule()
        {
            // Arrange
            dynamic param = new ExpandoObject();

            param.purchased  = 3;
            param.chargedfor = 2;
            // Act
            var result = RuleMaker.MakeRule("Classic Ad", "discount", param);

            // Assert
            Assert.AreEqual("Classic Ad", result.ProductName);
        }