Exemple #1
0
        public void IfFalse()
        {
            var node = new IfNode(
                FalseCondition,
                new CollectionNodeReader(new[] {
                    BadNode,
                    new EndDirectiveNode(null, null, "endif"),
                    BadNode,
                }),
                "if"
            );

            var context = new ExecutionContext();

            Assert.IsNull(node.GetTrueConditionSet(context));
        }
Exemple #2
0
        public void IfFalseElse()
        {
            var node = new IfNode(
                FalseCondition,
                new CollectionNodeReader(new[] {
                    BadNode,
                    new ElseNode(null, null),
                    GoodNode,
                    new EndDirectiveNode(null, null, "endif"),
                    BadNode,
                }),
                "if"
            );

            var context = new ExecutionContext();

            Assert.AreEqual(new[] { GoodNode }, node.GetTrueConditionSet(context).ChildrenNodes);
        }