src/GenFx.Components.Tests/TreeNode.OfT.Test.cs
/// <summary>
/// Tests that the <see cref="TreeNode{T}.Clone"/> method works correctly.
/// </summary>
Tests that the  method works correctly.
Tests that the method works correctly .
[Fact]
        public void TreeNodeOfT_Clone()
        {
            TestTreeEntity entity = new TestTreeEntity();
            TreeNode<int> node = new TreeNode<int>();
            entity.SetRootNode(node);
            node.AppendChild(new TreeNode());
            node.Value = 10;
            TestTreeEntity newEntity = new TestTreeEntity();
            TreeNode newParent = new TreeNode();
            newEntity.SetRootNode(newParent);
            TreeNode clone = node.Clone(newEntity, newParent);
            Assert.NotSame(node, clone);
            Assert.NotSame(node.ChildNodes[0], clone.ChildNodes[0]);
            Assert.Same(newEntity, clone.Tree);
            Assert.Same(newParent, clone.ParentNode);
            Assert.Equal(node.Value, clone.Value);
        }
[ Fact ] public void TreeNodeOfT_Clone ( ) { TestTreeEntity entity = new TestTreeEntity ( ) ; TreeNode < int > node = new TreeNode < int > ( ) ; entity . SetRootNode ( node ) ; node . AppendChild ( new TreeNode ( ) ) ; node . Value = 10 ; TestTreeEntity newEntity = new TestTreeEntity ( ) ; TreeNode newParent = new TreeNode ( ) ; newEntity . SetRootNode ( newParent ) ; TreeNode clone = node . Clone ( newEntity , newParent ) ; Assert . NotSame ( node , clone ) ; Assert . NotSame ( node . ChildNodes [ 0 ] , clone . ChildNodes [ 0 ] ) ; Assert . Same ( newEntity , clone . Tree ) ; Assert . Same ( newParent , clone . ParentNode ) ; Assert . Equal ( node . Value , clone . Value ) ; }
Tests that the  method works correctly.
Tests that the method works correctly .