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));
		}
Example #2
0
        public static void AssertKeys(Transaction transaction, BTree btree, int[] keys)
        {
            ExpectingVisitor visitor = ExpectingVisitor.CreateExpectingVisitor(keys);

            btree.TraverseKeys(transaction, visitor);
            visitor.AssertExpectations();
        }
Example #3
0
		private void AssertIndex(object[] expected)
		{
			ExpectingVisitor visitor = new ExpectingVisitor(expected);
			IClassIndexStrategy index = ClassMetadataFor(typeof(ClassIndexTestCase.Item)).Index
				();
			index.TraverseIds(Trans(), visitor);
			visitor.AssertExpectations();
		}
		public virtual void TestTraverseValues()
		{
			IStoredField field = StoredField();
			ExpectingVisitor expectingVisitor = new ExpectingVisitor(IntArrays4.ToObjectArray
				(Foos));
			field.TraverseValues(expectingVisitor);
			expectingVisitor.AssertExpectations();
		}
Example #5
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));
        }
Example #6
0
 private void AssertIndex(object[] expected)
 {
     var visitor = new ExpectingVisitor(expected);
     var index = ClassMetadataFor(typeof (Item)).Index
         ();
     index.TraverseAll(Trans(), visitor);
     visitor.AssertExpectations();
 }
		protected virtual void AssertItems(string[] expected, IObjectSet result)
		{
			ExpectingVisitor expectingVisitor = new ExpectingVisitor(ToObjectArray(expected));
			while (result.HasNext())
			{
				expectingVisitor.Visit(((StringIndexTestCaseBase.Item)result.Next()).name);
			}
			expectingVisitor.AssertExpectations();
		}
Example #8
0
        public static void AssertRange(int[] expectedKeys, IBTreeRange range)
        {
            Assert.IsNotNull(range);
            ExpectingVisitor visitor = ExpectingVisitor.CreateSortedExpectingVisitor(expectedKeys
                                                                                     );

            TraverseKeys(range, visitor);
            visitor.AssertExpectations();
        }
Example #9
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();
 }
Example #10
0
        public static void AssertSingleElement(Transaction trans, BTree btree, object element
                                               )
        {
            Assert.AreEqual(1, btree.Size(trans));
            IBTreeRange      result           = btree.SearchRange(trans, element);
            ExpectingVisitor expectingVisitor = new ExpectingVisitor(new object[] { element }
                                                                     );

            BTreeAssert.TraverseKeys(result, expectingVisitor);
            expectingVisitor.AssertExpectations();
            expectingVisitor = new ExpectingVisitor(new object[] { element });
            btree.TraverseKeys(trans, expectingVisitor);
            expectingVisitor.AssertExpectations();
        }
		public static void AssertSingleElement(Transaction trans, BTree btree, object element
			)
		{
			Assert.AreEqual(1, btree.Size(trans));
			IBTreeRange result = btree.SearchRange(trans, element);
			ExpectingVisitor expectingVisitor = new ExpectingVisitor(new object[] { element }
				);
			BTreeAssert.TraverseKeys(result, expectingVisitor);
			expectingVisitor.AssertExpectations();
			expectingVisitor = new ExpectingVisitor(new object[] { element });
			btree.TraverseKeys(trans, expectingVisitor);
			expectingVisitor.AssertExpectations();
		}
 private void AssertContains(IReferenceSystem referenceSystem, object[] objects)
 {
     var expectingVisitor = new ExpectingVisitor(objects);
     referenceSystem.TraverseReferences(expectingVisitor);
     expectingVisitor.AssertExpectations();
 }
			public _IVisitor4_62(ExpectingVisitor expectingVisitor)
			{
				this.expectingVisitor = expectingVisitor;
			}
Example #14
0
		private void AssertIDs(IQueryResult queryResult, int[] expectedIDs, bool ignoreUnexpected
			)
		{
			ExpectingVisitor expectingVisitor = new ExpectingVisitor(IntArrays4.ToObjectArray
				(expectedIDs), false, ignoreUnexpected);
			IIntIterator4 i = queryResult.IterateIDs();
			while (i.MoveNext())
			{
				expectingVisitor.Visit(i.CurrentInt());
			}
			expectingVisitor.AssertExpectations();
		}
 public _IVisitor4_113(ExpectingVisitor visitor)
 {
     this.visitor = visitor;
 }