Exemplo n.º 1
0
        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());
        }
Exemplo n.º 2
0
        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());
        }
Exemplo n.º 3
0
        public void ItShouldNotValidateWhenNoRules()
        {
            var rule = new RuleTree <int, int>();

            Assert.Throws(typeof(RuleException), () => rule.Validate());
        }