Exemple #1
0
            public void AddChild()
            {
                INode <string> node = new SimpleNode <string>("SomeObject1", null);

                node.AddChild(new SimpleNode <string>("SomeObject2", node));
                node.AddChild(new SimpleNode <string>("SomeObject3", node));
                node.AddChild(new SimpleNode <string>("SomeObject4", node));

                Assert.IsNotNull(node);
                Assert.AreEqual(3, node.Children.ToList().Count);
            }
Exemple #2
0
            public void SetCurrentNode()
            {
                this.RegisterDependencies();
                INodeManager <INode <string>, string> nodeManager = DiManager.GetInstance().Resolve <INodeManager <INode <string>, string> >();
                INode <string> node = new SimpleNode <string>("Somestring", null);

                node.AddChild(new SimpleNode <string>("Somestring2", node));
                node.AddChild(new SimpleNode <string>("Somestring3", node));
                node.AddChild(new SimpleNode <string>("Somestring4", node));

                nodeManager.AddRoot(node);
                INode <string> currentNode = nodeManager.ActiveNode;

                nodeManager.Traverse(1);
                INode <string> currentNodeNew = nodeManager.ActiveNode;

                Assert.IsNotNull(currentNodeNew);
                Assert.AreEqual(node.Children.ToList()[1].Id, currentNodeNew.Id);
            }