Exemplo n.º 1
0
        public void add_node_to_another_node()
        {
            var graph = new NavigationGraph();
            var parentNode = MenuNode.Node(FakeKeys.Key1);
            graph.AddChildNode(FakeKeys.Key2, parentNode);

            var childNode = MenuNode.Node(FakeKeys.Key3);

            graph.AddChildNode(FakeKeys.Key1, childNode);

            graph.Compile();

            parentNode.Children.Top
                .ShouldBeTheSameAs(childNode);
        }
Exemplo n.º 2
0
        public void add_node_and_parent_does_not_exist()
        {
            var graph = new NavigationGraph();

            var node = MenuNode.Node(FakeKeys.Key1);

            graph.AddChildNode(FakeKeys.Key2, node);

            graph.Compile();

            graph.MenuFor(FakeKeys.Key2).Top
                .ShouldBeTheSameAs(node);
        }