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

            btree.TraverseKeys(transaction, visitor);
            visitor.AssertExpectations();
        }
Ejemplo n.º 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();
		}
Ejemplo n.º 4
0
		public virtual void TestTraverseValues()
		{
			IStoredField field = StoredField();
			ExpectingVisitor expectingVisitor = new ExpectingVisitor(IntArrays4.ToObjectArray
				(Foos));
			field.TraverseValues(expectingVisitor);
			expectingVisitor.AssertExpectations();
		}
Ejemplo n.º 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));
        }
Ejemplo n.º 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();
		}
Ejemplo n.º 8
0
        public static void AssertRange(int[] expectedKeys, IBTreeRange range)
        {
            Assert.IsNotNull(range);
            ExpectingVisitor visitor = ExpectingVisitor.CreateSortedExpectingVisitor(expectedKeys
                                                                                     );

            TraverseKeys(range, visitor);
            visitor.AssertExpectations();
        }
Ejemplo n.º 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();
 }
Ejemplo n.º 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();
        }
Ejemplo n.º 11
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();
		}
 private void AssertContains(IReferenceSystem referenceSystem, object[] objects)
 {
     var expectingVisitor = new ExpectingVisitor(objects);
     referenceSystem.TraverseReferences(expectingVisitor);
     expectingVisitor.AssertExpectations();
 }
Ejemplo n.º 13
0
			public _IVisitor4_62(ExpectingVisitor expectingVisitor)
			{
				this.expectingVisitor = expectingVisitor;
			}
Ejemplo n.º 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;
 }