public void navigation_method_on_fubu_registry_works() { var registry = new FubuRegistry(); registry.Navigation(x => { x.ForMenu(FakeKeys.Key1); x.Add += MenuNode.Node(FakeKeys.Key2); x.Add += MenuNode.Node(FakeKeys.Key3); }); var graph = BehaviorGraph.BuildFrom(registry).Settings.Get <NavigationGraph>(); graph.MenuFor(FakeKeys.Key1).Select(x => x.Key) .ShouldHaveTheSameElementsAs(FakeKeys.Key2, FakeKeys.Key3); }
public void import_with_strings_instead_of_StringToken() { var registry = new FubuRegistry(); registry.Navigation(x => { x.ForMenu("Key1"); x.Add += MenuNode.Node("Key2"); x.Add += MenuNode.Node("Key3"); }); registry.Import <ChildRegistry>(); var graph = BehaviorGraph.BuildFrom(registry).Settings.Get <NavigationGraph>(); graph.MenuFor("Key1").Select(x => x.Key) .ShouldHaveTheSameElementsAs(new NavigationKey("Key2"), new NavigationKey("Key3")); }
public void import_navigation_from_child_registry() { var registry = new FubuRegistry(); registry.Navigation(x => { x.ForMenu(FakeKeys.Key1); x.Add += MenuNode.Node(FakeKeys.Key2); x.Add += MenuNode.Node(FakeKeys.Key3); }); registry.Import <ChildRegistry>(); var graph = BehaviorGraph.BuildFrom(registry).Settings.Get <NavigationGraph>(); graph.MenuFor(FakeKeys.Key1).Select(x => x.Key) .ShouldHaveTheSameElementsAs(FakeKeys.Key2, FakeKeys.Key3, FakeKeys.Key4, FakeKeys.Key5); graph.MenuFor(FakeKeys.Key6).Select(x => x.Key) .ShouldHaveTheSameElementsAs(FakeKeys.Key7, FakeKeys.Key8); }