Ejemplo n.º 1
0
        public void Recursion()
        {
            ConcreteTreeNode t = _runner.CreateNode <ConcreteTreeNode>();
            ConcreteTreeNode b = _runner.CreateNode <ConcreteTreeNode>();

            t.AddChild(b);
            b.AddChild(_runner.CreateNode <ConcreteTreeNode>());
            b.AddChild(_runner.CreateNode <ConcreteTreeNode>());

            Assert.AreEqual(3, t.GetChildrenRecursive <ConcreteTreeNode>().Count());
            Assert.AreEqual(3, t.CountChildrenRecursive());
        }
Ejemplo n.º 2
0
        public void Removal()
        {
            ConcreteTreeNode t = _runner.CreateNode <ConcreteTreeNode>();
            ConcreteTreeNode b = _runner.CreateNode <ConcreteTreeNode>();

            t.AddChild(b);
            b.AddChild(_runner.CreateNode <ConcreteTreeNode>());
            b.AddChild(_runner.CreateNode <ConcreteTreeNode>());

            t.RemoveAndDestroyChild(t.children.First());

            Assert.AreEqual(1, _relay.tables["nodes"].Count());
        }
Ejemplo n.º 3
0
        public void SaveAndLoad()
        {
            ConcreteTreeNode t = _runner.CreateNode <ConcreteTreeNode>();

            t.AddChild(_runner.CreateNode <ConcreteTreeNode>());
            t.AddChild(_runner.CreateNode <ConcreteTreeNode>());

            _runner = new RelayTreeRunner(_relay, "nodes");

            t = _runner.GetNode <ConcreteTreeNode>(t.objectId);
            Assert.NotNull(t);
            Assert.AreEqual(2, t.childCount);
        }