src/GenFx.Components.Tests/TreeHelperTest.cs
/// <summary>
/// Tests that the <see cref="TreeHelper.ReplaceNodeInTree"/> method works correctly.
/// </summary>
Tests that the  method works correctly.
Tests that the method works correctly .
[Fact]
        public void TreeHelper_ReplaceNodeInTree()
        {
            TestTree tree1 = CreateTree1();
            TestTree tree2 = CreateTree2();
            TreeNode movingNode = tree1.RootNode.ChildNodes[0]; 
            TreeNode locationNode = tree2.RootNode.ChildNodes[2]; 
            TreeNode locationParentNode = locationNode.ParentNode;
            TreeHelper.ReplaceNodeInTree(movingNode, tree2, locationNode, locationParentNode);
            Assert.Equal(3, locationParentNode.ChildNodes.Count);
            Assert.DoesNotContain(locationNode, locationParentNode.ChildNodes);
            Assert.Same(movingNode, locationParentNode.ChildNodes[2]);
            Assert.Single(movingNode.ChildNodes);
        }
[ Fact ] public void TreeHelper_ReplaceNodeInTree ( ) { TestTree tree1 = CreateTree1 ( ) ; TestTree tree2 = CreateTree2 ( ) ; TreeNode movingNode = tree1 . RootNode . ChildNodes [ 0 ] ; TreeNode locationNode = tree2 . RootNode . ChildNodes [ 2 ] ; TreeNode locationParentNode = locationNode . ParentNode ; TreeHelper . ReplaceNodeInTree ( movingNode , tree2 , locationNode , locationParentNode ) ; Assert . Equal ( 3 , locationParentNode . ChildNodes . Count ) ; Assert . DoesNotContain ( locationNode , locationParentNode . ChildNodes ) ; Assert . Same ( movingNode , locationParentNode . ChildNodes [ 2 ] ) ; Assert . Single ( movingNode . ChildNodes ) ; }
Tests that the  method works correctly.
Tests that the method works correctly .
// node2 // node4