private void AssertContains(IReferenceSystem referenceSystem, object[] objects)
        {
            ExpectingVisitor expectingVisitor = new ExpectingVisitor(objects);

            referenceSystem.TraverseReferences(expectingVisitor);
            expectingVisitor.AssertExpectations();
        }
示例#2
0
        protected virtual void AssertTreeInt(int[] expectedValues, TreeInt treeInt)
        {
            ExpectingVisitor visitor = ExpectingVisitor.CreateExpectingVisitor(expectedValues
                                                                               );

            treeInt.Traverse(new _IVisitor4_113(visitor));
            visitor.AssertExpectations();
        }
示例#3
0
        public virtual void TestTraverseValues()
        {
            IStoredField     field            = StoredField();
            ExpectingVisitor expectingVisitor = new ExpectingVisitor(IntArrays4.ToObjectArray
                                                                         (Foos));

            field.TraverseValues(expectingVisitor);
            expectingVisitor.AssertExpectations();
        }
示例#4
0
        private void AssertIndex(object[] expected)
        {
            ExpectingVisitor    visitor = new ExpectingVisitor(expected);
            IClassIndexStrategy index   = ClassMetadataFor(typeof(ClassIndexTestCase.Item)).Index
                                              ();

            index.TraverseAll(Trans(), visitor);
            visitor.AssertExpectations();
        }
示例#5
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();
        }
        private void AssertIterateValues(int[] values)
        {
            ExpectingVisitor expectingVisitor = new ExpectingVisitor(IntArrays4.ToObjectArray
                                                                         (values), true, false);
            IEnumerator i = new TreeKeyIterator(CreateTree(values));

            while (i.MoveNext())
            {
                expectingVisitor.Visit(i.Current);
            }
            expectingVisitor.AssertExpectations();
        }
        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();
        }
示例#9
0
        private void ExpectKeysSearch(BTree btree, int[] values)
        {
            int lastValue = int.MinValue;

            for (int i = 0; i < values.Length; i++)
            {
                if (values[i] != lastValue)
                {
                    ExpectingVisitor expectingVisitor = ExpectingVisitor.CreateExpectingVisitor(values
                                                                                                [i], IntArrays4.Occurences(values, values[i]));
                    IBTreeRange range = FieldIndexKeySearch(Trans(), btree, values[i]);
                    BTreeAssert.TraverseKeys(range, new _IVisitor4_62(expectingVisitor));
                    expectingVisitor.AssertExpectations();
                    lastValue = values[i];
                }
            }
        }
示例#10
0
        private void ExpectKeysSearch(Transaction trans, BTree btree, int[] keys)
        {
            int lastValue = int.MinValue;

            for (int i = 0; i < keys.Length; i++)
            {
                if (keys[i] != lastValue)
                {
                    ExpectingVisitor expectingVisitor = ExpectingVisitor.CreateExpectingVisitor(keys[
                                                                                                    i], IntArrays4.Occurences(keys, keys[i]));
                    IBTreeRange range = btree.SearchRange(trans, keys[i]);
                    BTreeAssert.TraverseKeys(range, expectingVisitor);
                    expectingVisitor.AssertExpectations();
                    lastValue = keys[i];
                }
            }
        }