public virtual void TestMoveNextAfterCompletion()
		{
			IEnumerator i = new TreeNodeIterator(CreateTree(Values));
			while (i.MoveNext())
			{
			}
			Assert.IsFalse(i.MoveNext());
		}
Exemplo n.º 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;
 }
		public virtual void TestEmpty()
		{
			IEnumerator i = new TreeNodeIterator(null);
			Assert.IsFalse(i.MoveNext());
		}
		private void AssertIterateValues(int[] values)
		{
			Tree tree = CreateTree(Values);
			IEnumerator i = new TreeNodeIterator(tree);
			tree.Traverse(new _IVisitor4_42(i));
		}