Esempio n. 1
0
        public void deep_topic_graph()
        {
            var graph = new TopicGraph();
            graph.For<CTopic>().Append<DTopic>();
            graph.For<ATopic>().Append<BTopic>().Append<CTopic>();

            graph.Find<ATopic>().ChildNodes.ShouldHaveTheSameElementsAs(TopicNode.For<BTopic>(), TopicNode.For<CTopic>());
            graph.Find<CTopic>().ChildNodes.ShouldHaveTheSameElementsAs(TopicNode.For<DTopic>());
        }
Esempio n. 2
0
        public void deep_topic_graph()
        {
            var graph = new TopicGraph();

            graph.For <CTopic>().Append <DTopic>();
            graph.For <ATopic>().Append <BTopic>().Append <CTopic>();

            graph.Find <ATopic>().ChildNodes.ShouldHaveTheSameElementsAs(TopicNode.For <BTopic>(), TopicNode.For <CTopic>());
            graph.Find <CTopic>().ChildNodes.ShouldHaveTheSameElementsAs(TopicNode.For <DTopic>());
        }
Esempio n. 3
0
        public void got_all()
        {
            var graph = new TopicGraph();
            graph.For<CTopic>().Append<DTopic>();
            graph.For<ATopic>().Append<BTopic>().Append<CTopic>();

            var types = graph.All().Select(x => x.TopicType);

            types.ShouldHaveTheSameElementsAs(typeof(ATopic), typeof(BTopic), typeof(CTopic), typeof(DTopic));
        }
Esempio n. 4
0
        public void find_by_name()
        {
            var graph = new TopicGraph();
            graph.For<CTopic>().Append<DTopic>();
            graph.For<ATopic>().Append<BTopic>().Append<CTopic>();

            graph.FindByName("atopic").TopicType.ShouldEqual(typeof (ATopic));
            graph.FindByName("ctopic").TopicType.ShouldEqual(typeof(CTopic));
            graph.FindByName("dtopic").TopicType.ShouldEqual(typeof(DTopic));
        }
Esempio n. 5
0
        public void got_all()
        {
            var graph = new TopicGraph();

            graph.For <CTopic>().Append <DTopic>();
            graph.For <ATopic>().Append <BTopic>().Append <CTopic>();

            var types = graph.All().Select(x => x.TopicType);

            types.ShouldHaveTheSameElementsAs(typeof(ATopic), typeof(BTopic), typeof(CTopic), typeof(DTopic));
        }
Esempio n. 6
0
        public void can_find_topic_in_children_just_fine()
        {
            var graph = new TopicGraph();

            graph.For <ATopic>().Append <BTopic>().Append <CTopic>();

            graph.Find <BTopic>().Parent.ShouldBeTheSameAs(graph.Find <ATopic>());
            graph.Find <CTopic>().Parent.ShouldBeTheSameAs(graph.Find <ATopic>());

            graph.TopLevelNodes().ShouldHaveTheSameElementsAs(TopicNode.For <ATopic>());
        }
Esempio n. 7
0
        public void can_find_topic_in_children_just_fine()
        {
            var graph = new TopicGraph();

            graph.For<ATopic>().Append<BTopic>().Append<CTopic>();

            graph.Find<BTopic>().Parent.ShouldBeTheSameAs(graph.Find<ATopic>());
            graph.Find<CTopic>().Parent.ShouldBeTheSameAs(graph.Find<ATopic>());

            graph.TopLevelNodes().ShouldHaveTheSameElementsAs(TopicNode.For<ATopic>());
        }
Esempio n. 8
0
        public void find_by_name()
        {
            var graph = new TopicGraph();

            graph.For <CTopic>().Append <DTopic>();
            graph.For <ATopic>().Append <BTopic>().Append <CTopic>();


            graph.FindByName("atopic").TopicType.ShouldEqual(typeof(ATopic));
            graph.FindByName("ctopic").TopicType.ShouldEqual(typeof(CTopic));
            graph.FindByName("dtopic").TopicType.ShouldEqual(typeof(DTopic));
        }
Esempio n. 9
0
        static ObjectMother()
        {
            FubuMvcPackageFacility.PhysicalRootPath = ".".ToFullPath().ParentDirectory().ParentDirectory();
            var registry = new FubuRegistry();

            registry.Import <FubuDocsExtension>();

            FubuRuntime app = FubuApplication
                              .For(registry)
                              .StructureMap(new Container())
                              .Bootstrap();

            TopicGraph = TopicGraph.AllTopics;

            Behaviors = app.Factory.Get <BehaviorGraph>();

            ProjectRoot = TopicGraph.AllTopics.ProjectFor("FubuMVC");

            Topics = new Cache <string, Topic>();
            Topics[ProjectRoot.Index.Key] = ProjectRoot.Index;
            ProjectRoot.Index.Descendents().Each(x => Topics[x.Key] = x);

            Files = Topics.Select(x => x.File).ToArray();
        }
Esempio n. 10
0
        public void does_return_the_same_topic_per_type()
        {
            var graph = new TopicGraph();

            graph.Find <ATopic>().ShouldBeTheSameAs(graph.Find <ATopic>());
        }
Esempio n. 11
0
        public void can_find_topic_on_the_fly()
        {
            var graph = new TopicGraph();

            graph.Find <ATopic>().ShouldNotBeNull();
        }
Esempio n. 12
0
 public void does_return_the_same_topic_per_type()
 {
     var graph = new TopicGraph();
     graph.Find<ATopic>().ShouldBeTheSameAs(graph.Find<ATopic>());
 }
Esempio n. 13
0
 public void can_find_topic_on_the_fly()
 {
     var graph = new TopicGraph();
     graph.Find<ATopic>().ShouldNotBeNull();
 }