Ejemplo n.º 1
0
 public virtual void TestMoveNextAfterCompletion()
 {
     IEnumerator i = new TreeKeyIterator(CreateTree(Values));
     while (i.MoveNext())
     {
     }
     Assert.IsFalse(i.MoveNext());
 }
Ejemplo n.º 2
0
 private void AssertIterateValues(int[] values)
 {
     var expectingVisitor = new ExpectingVisitor(IntArrays4.ToObjectArray
         (values), true, false);
     IEnumerator i = new TreeKeyIterator(CreateTree(values));
     while (i.MoveNext())
     {
         expectingVisitor.Visit(i.Current);
     }
     expectingVisitor.AssertExpectations();
 }
Ejemplo n.º 3
0
 public virtual void Flush(DefragmentServicesImpl context)
 {
     if (_ids == null)
     {
         return;
     }
     IEnumerator idIter = new TreeKeyIterator(_ids);
     while (idIter.MoveNext())
     {
         var objectID = ((int) idIter.Current);
         var isClassID = false;
         if (objectID < 0)
         {
             objectID = -objectID;
             isClassID = true;
         }
         // seen object ids don't come by here anymore - any other candidates?
         context.MapIDs(objectID, context.TargetNewId(), isClassID);
     }
     context.Mapping().Commit();
     _ids = null;
 }
Ejemplo n.º 4
0
 public virtual void TestEmpty()
 {
     IEnumerator i = new TreeKeyIterator(null);
     Assert.IsFalse(i.MoveNext());
 }