public void should_throw_for_unrecognized_comparison_operators() { var ruleEngine = new RuleEngine(); Assert.Throws<UnrecognizedComparisonOperatorException>(() => { ruleEngine.CheckCondition("Age > 10 OR TotalProjects notexistsoperator 5", new Person { Age = 5 }); }); }
public void should_throw_for_unrecognized_params() { var ruleEngine = new RuleEngine(); Assert.Throws<UnrecognizedParameterException>(() => { var condition = "Age > 10 OR NotExistParam == 5"; ruleEngine.CheckCondition(condition, new Person { Age = 10 }); }); }
private bool CheckCondition(string condition, object contextModel) { var ruleEngine = new RuleEngine(); return ruleEngine.CheckCondition(condition, contextModel); }