src/GenFx.Components.Tests/TreeNodeTest.cs
/// <summary>
/// Tests that the InsertChild method works correctly.
/// </summary>
Tests that the InsertChild method works correctly.
Tests that the InsertChild method works correctly .
[Fact]
        public void TreeNode_InsertChild()
        {
            GeneticAlgorithm algorithm = GetAlgorithm();
            TestTreeEntity entity = new TestTreeEntity();
            entity.Initialize(algorithm);
            TreeNode node = new TreeNode();
            entity.SetRootNode(node);
            TreeNode child1 = new TreeNode();
            TreeNode child2 = new TreeNode();
            node.InsertChild(0, child1);
            node.InsertChild(0, child2);
            Assert.Same(child2, node.ChildNodes[0]);
            Assert.Same(node, child2.ParentNode);
            Assert.Same(entity, child2.Tree);
            Assert.Same(child1, node.ChildNodes[1]);
            Assert.Same(node, child1.ParentNode);
            Assert.Same(entity, child1.Tree);
        }
[ Fact ] public void TreeNode_InsertChild ( ) { GeneticAlgorithm algorithm = GetAlgorithm ( ) ; TestTreeEntity entity = new TestTreeEntity ( ) ; entity . Initialize ( algorithm ) ; TreeNode node = new TreeNode ( ) ; entity . SetRootNode ( node ) ; TreeNode child1 = new TreeNode ( ) ; TreeNode child2 = new TreeNode ( ) ; node . InsertChild ( 0 , child1 ) ; node . InsertChild ( 0 , child2 ) ; Assert . Same ( child2 , node . ChildNodes [ 0 ] ) ; Assert . Same ( node , child2 . ParentNode ) ; Assert . Same ( entity , child2 . Tree ) ; Assert . Same ( child1 , node . ChildNodes [ 1 ] ) ; Assert . Same ( node , child1 . ParentNode ) ; Assert . Same ( entity , child1 . Tree ) ; }
Tests that the InsertChild method works correctly.
Tests that the InsertChild method works correctly .