예제 #1
0
        public void CompletedThingsDigidocTest()
        {
            var thingGraph = new ThingGraph();
            var factory    = new DigidocSampleFactory();

            factory.Graph = thingGraph;
            factory.Populate();

            var graph           = new SchemaThingGraph(thingGraph);
            var expectedDefault = new IThing[] {
                DigidocSchema.Document,
                DigidocSchema.DocumentTitle,
                DigidocSchema.DocumentDefaultLink,
                DigidocSchema.PageNumber,
                DigidocSchema.PageDefaultLink,
                DigidocSchema.DocumentPage,
                DigidocSchema.HidePagesLink,
                ViewMetaSchema.Hide,
                MetaSchema.DescriptionMarker,
            };

            var pageItems = new List <IThing> ();

            for (int i = 0; i < factory.PageCount; i++)
            {
                pageItems.Add(factory.Nodes[factory.PageNodeStart + i * 2]);
                pageItems.Add(factory.Edges[factory.PageEdgeStart + i * 2]);
            }
            Prove(
                new IThing[] { factory.Nodes[1] },
                expectedDefault.Union(
                    new IThing[] {
                factory.Nodes[1],
                factory.Nodes[2],
                factory.Edges[1],
            }).Union(
                    pageItems
                    )
                , graph);

            Prove(
                new IThing[] { factory.Nodes[1], factory.Nodes[3], factory.Edges[2] },
                expectedDefault.Union(
                    new IThing[] {
                factory.Nodes[1],
                factory.Nodes[2],
                factory.Nodes[3],
                factory.Nodes[4],
                factory.Edges[1],
                factory.Edges[2],
                factory.Edges[3],
            }).Union(
                    pageItems
                    )
                , graph);
        }