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>()); }
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>()); }
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)); }
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)); }
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)); }
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>()); }
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>()); }
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)); }
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(); }
public void does_return_the_same_topic_per_type() { var graph = new TopicGraph(); graph.Find <ATopic>().ShouldBeTheSameAs(graph.Find <ATopic>()); }
public void can_find_topic_on_the_fly() { var graph = new TopicGraph(); graph.Find <ATopic>().ShouldNotBeNull(); }
public void does_return_the_same_topic_per_type() { var graph = new TopicGraph(); graph.Find<ATopic>().ShouldBeTheSameAs(graph.Find<ATopic>()); }
public void can_find_topic_on_the_fly() { var graph = new TopicGraph(); graph.Find<ATopic>().ShouldNotBeNull(); }