示例#1
0
        public virtual void TestMoveNextAfterCompletion()
        {
            IEnumerator i = new TreeNodeIterator(CreateTree(Values));

            while (i.MoveNext())
            {
            }
            Assert.IsFalse(i.MoveNext());
        }
示例#2
0
        private static ReflectConstructorSpec FindConstructor(IReflectClass claxx, Tree sortedConstructors
                                                              )
        {
            if (sortedConstructors == null)
            {
                return(ReflectConstructorSpec.InvalidConstructor);
            }
            IEnumerator iter = new TreeNodeIterator(sortedConstructors);

            while (iter.MoveNext())
            {
                var current     = iter.Current;
                var constructor = (IReflectConstructor)((TreeIntObject)current)._object;
                var args        = NullArgumentsFor(constructor);
                var res         = constructor.NewInstance(args);
                if (res != null)
                {
                    return(new ReflectConstructorSpec(constructor, args));
                }
            }
            return(ReflectConstructorSpec.InvalidConstructor);
        }
示例#3
0
        public virtual void TestEmpty()
        {
            IEnumerator i = new TreeNodeIterator(null);

            Assert.IsFalse(i.MoveNext());
        }