コード例 #1
0
        public void RuleFailsIfTotalIsMissingFromNodeStructure()
        {
            var mustHaveTotalRule = new MustHaveTotalRule();
            var rootNode          = new Node();

            var ruleResult = mustHaveTotalRule.RunRule(ref rootNode);

            Assert.AreEqual(false, ruleResult.RulePassed);
        }
コード例 #2
0
        public void RuleFailsPassesIfTotalIsPresent()
        {
            var mustHaveTotalRule = new MustHaveTotalRule();
            var rootNode          = new Node()
            {
                Children = { new Node()
                             {
                                 Name = TagNames.Total
                             } }
            };

            var ruleResult = mustHaveTotalRule.RunRule(ref rootNode);

            Assert.AreEqual(true, ruleResult.RulePassed);
        }