public void ItShouldNotValidateWhenNoOperations() { var rule = new RuleTree <int, int> { I = new Mock <Rule <int, int> >().Object, J = new Mock <Rule <int, int> >().Object }; Assert.Throws(typeof(RuleException), () => rule.Validate()); }
public void ItShouldvalidateWhenRulesAndOperation() { var rule = new RuleTree <int, int> { I = new Mock <Rule <int, int> >().Object, J = new Mock <IRule <int, int> >().Object, Operation = new Mock <IOperation>().Object }; Assert.IsTrue(rule.Validate()); }
public void ItShouldNotValidateWhenNoRules() { var rule = new RuleTree <int, int>(); Assert.Throws(typeof(RuleException), () => rule.Validate()); }