An abstract configured graph.
Inheritance: IRegisteredGraph
        protected override void Given()
        {
            registeredGraph = new RegisteredGraph<ClassWithTwoAncestors>(registry);

            trackedGraph = new TrackedGraph(new StoredGraph(new InternalId(Guid.NewGuid()), registeredGraph.GraphType, new PreservedMemoryStream("letspretendthisisserialiseddata".Select(_ => (byte)_).ToArray())), Enumerable.Empty<IProjectedIndex>(), registeredGraph);

            Subject.InTransactionDo(_ => _.InsertGraph(trackedGraph));
        }
Beispiel #2
0
        protected override void WithContext()
        {
            base.WithContext();

            RegisteredGraph = new RegisteredGraph<ClassWithTwoAncestors>(Registry);
            RegisteredIndexer = new RegisteredIndexer<ClassWithTwoAncestors, int>(new IntIndex(), Registry);
            Registry.RegisteredIndexers.Add(RegisteredIndexer);
            Subject.EnsureIndex(RegisteredIndexer);
        }
        protected override void Given()
        {
            registeredGraph = new RegisteredGraph<ClassWithTwoAncestors>(registry);
            registeredIndexer = new RegisteredIndexer<ClassWithTwoAncestors, int>(new IntIndex(), registry);
            registry.RegisteredIndexers.Add(registeredIndexer);

            originalTrackedGraph = new TrackedGraph(new StoredGraph(new InternalId(Guid.NewGuid()), registeredGraph.GraphType, new PreservedMemoryStream("thisistheserialisedgraphofthefirstobject".Select(_ => (byte)_).ToArray())), new IProjectedIndex[]
                {
                    new ProjectedIndex<int>(registeredIndexer.IndexName, 1),
                    new ProjectedIndex<int>(registeredIndexer.IndexName, 2)
                }, registeredGraph);

            updatedTrackedGraph = new TrackedGraph(new StoredGraph(originalTrackedGraph.StoredGraph.InternalId, registeredGraph.GraphType, new PreservedMemoryStream("thesecondobjectsserialisedgraph".Select(_ => (byte)_).ToArray())), new IProjectedIndex[]
                {
                    new ProjectedIndex<int>(registeredIndexer.IndexName, 2),
                    new ProjectedIndex<int>(registeredIndexer.IndexName, 3)
                }, registeredGraph);

            Subject.EnsureIndex(registeredIndexer);
            Subject.InTransactionDo(_ => _.InsertGraph(originalTrackedGraph));
        }
        protected override void Given()
        {
            firstRegisteredGraph = new RegisteredGraph<ClassWithTwoAncestors>(registry);
            secondRegisteredGraph = new RegisteredGraph<OtherClassWithTwoAncestors>(registry);
            registeredIndexer = new RegisteredIndexer<ClassWithTwoAncestors, int>(new IntIndex(), registry);
            registry.RegisteredIndexers.Add(registeredIndexer);

            firstTrackedGraph = new TrackedGraph(new StoredGraph(new InternalId(Guid.NewGuid()), firstRegisteredGraph.GraphType, new PreservedMemoryStream("thisistheserialisedgraphofthefirstobject".Select(_ => (byte)_).ToArray())), new IProjectedIndex[]
                {
                    new ProjectedIndex<int>(registeredIndexer.IndexName, firstIndexDistinctIndexValue),
                    new ProjectedIndex<int>(registeredIndexer.IndexName, commonIndexValues)
                }, firstRegisteredGraph);

            secondTrackedGraph = new TrackedGraph(new StoredGraph(new InternalId(Guid.NewGuid()), secondRegisteredGraph.GraphType, new PreservedMemoryStream("thesecondobjectsserialisedgraph".Select(_ => (byte)_).ToArray())), new IProjectedIndex[]
                {
                    new ProjectedIndex<int>(registeredIndexer.IndexName, commonIndexValues),
                    new ProjectedIndex<int>(registeredIndexer.IndexName, secondIndexDistinctIndexValue)
                }, secondRegisteredGraph);

            Subject.EnsureIndex(registeredIndexer);
            Subject.InTransactionDo(_ => _.InsertGraph(firstTrackedGraph));
        }
        protected override void Given()
        {
            registeredGraph = new RegisteredGraph<ClassWithTwoAncestors>(registry);
            firstRegisteredIndexer = new RegisteredIndexer<ClassWithTwoAncestors, int>(new IntIndex(), registry);
            secondRegisteredIndexer = new RegisteredIndexer<ClassWithTwoAncestors, string>(new StringIndex(), registry);
            registry.RegisteredIndexers.Add(firstRegisteredIndexer);
            registry.RegisteredIndexers.Add(secondRegisteredIndexer);

            trackedGraph = new TrackedGraph(new StoredGraph(new InternalId(Guid.NewGuid()), registeredGraph.GraphType, new PreservedMemoryStream("letspretendthisisserialiseddata".Select(_ => (byte)_).ToArray())), new IProjectedIndex[]
                {
                    new ProjectedIndex<int>(firstRegisteredIndexer.IndexName, 1),
                    new ProjectedIndex<string>(secondRegisteredIndexer.IndexName, "wibble")
                }, registeredGraph);

            Subject.EnsureIndex(firstRegisteredIndexer);
            Subject.EnsureIndex(secondRegisteredIndexer);
        }