public void should_throw_for_unrecognized_params() { var ruleEngine = new ConditionEvaluator(); Assert.Throws<UnrecognizedParameterException>(() => { var condition = "Age > 10 OR NotExistParam == 5"; ruleEngine.Evaluate(condition, new Person { Age = 10 }); }); }
public PromotionModule( PromotionService promotionService, IPromotionPolicyProvider policyFactory, ConditionEvaluator ruleEngine) { Require.NotNull(promotionService, "promotionService"); Require.NotNull(policyFactory, "policyFactory"); Require.NotNull(ruleEngine, "ruleEngine"); _promotionService = promotionService; _policyFactory = policyFactory; _ruleEngine = ruleEngine; }
public override IEnumerable<ConfiguredActivity> Execute(object dataContext) { var evaluator = new ConditionEvaluator(); var success = evaluator.Evaluate(Conditions, dataContext); if (success) { return Further(Then, dataContext); } else { return Further(Else, dataContext); } }
public PromotionMatcher(ConditionEvaluator ruleEngine) { _ruleEngine = ruleEngine; }
private bool CheckCondition(string condition, object contextModel) { var ruleEngine = new ConditionEvaluator(); return ruleEngine.Evaluate(condition, contextModel); }
public PromotionConditionChecker(ConditionEvaluator ruleEngine) { _ruleEngine = ruleEngine; }