Esempio n. 1
0
        public void TestEdgesNoChildren()
        {
            var ci = new ChildIterable(true, 1, 5, x => (true));

            var prc = new ParserRuleContext();

            var iterator = ci.GetEnumerator(prc);

            iterator.Current.Should().BeNull();
            iterator.MoveNext().Should().BeFalse();
            iterator.Current.Should().BeNull();
        }
Esempio n. 2
0
        public void TestEdgeFewChildrens()
        {
            var ci = new ChildIterable(true, 1, 5, x => (true));

            var prc = new ParserRuleContext
            {
                children = new List <IParseTree>()
            };

            prc.children.Add(new ParserRuleContext());
            prc.children.Add(new ParserRuleContext());
            prc.children.Add(new ParserRuleContext());
            prc.children.Add(new ParserRuleContext());

            var iterator = ci.GetEnumerator(prc);

            var i = 0;

            while (i < 10)
            {
                i++;
                iterator.MoveNext();
            }
        }