예제 #1
0
		public static void AssertEmpty(Transaction transaction, BTree tree)
		{
			ExpectingVisitor visitor = new ExpectingVisitor(new object[0]);
			tree.TraverseKeys(transaction, visitor);
			visitor.AssertExpectations();
			Assert.AreEqual(0, tree.Size(transaction));
		}
예제 #2
0
 public static void AssertSingleElement(Transaction trans, BTree btree, object element
     )
 {
     Assert.AreEqual(1, btree.Size(trans));
     var result = btree.SearchRange(trans, element);
     var expectingVisitor = new ExpectingVisitor(new[] {element}
         );
     TraverseKeys(result, expectingVisitor);
     expectingVisitor.AssertExpectations();
     expectingVisitor = new ExpectingVisitor(new[] {element});
     btree.TraverseKeys(trans, expectingVisitor);
     expectingVisitor.AssertExpectations();
 }