src/GenFx.Components.Tests/TreeNodeTest.cs
/// <summary>
/// Tests that an exception is thrown when a child is inserted with a parent not assigned to a tree.
/// </summary>
Tests that an exception is thrown when a child is inserted with a parent not assigned to a tree.
Tests that an exception is thrown when a child is inserted with a parent not assigned to a tree .
[Fact]
        public void TreeNode_InsertChild_NoTree()
        {
            GeneticAlgorithm algorithm = GetAlgorithm();
            TestTreeEntity entity = new TestTreeEntity();
            entity.Initialize(algorithm);
            TreeNode node = new TreeNode();
            TreeNode child1 = new TreeNode();
            Assert.Throws<InvalidOperationException>(() => node.InsertChild(0, child1));
        }
[ Fact ] public void TreeNode_InsertChild_NoTree ( ) { GeneticAlgorithm algorithm = GetAlgorithm ( ) ; TestTreeEntity entity = new TestTreeEntity ( ) ; entity . Initialize ( algorithm ) ; TreeNode node = new TreeNode ( ) ; TreeNode child1 = new TreeNode ( ) ; Assert . Throws < InvalidOperationException > ( ( ) => node . InsertChild ( 0 , child1 ) ) ; }
Tests that an exception is thrown when a child is inserted with a parent not assigned to a tree.
Tests that an exception is thrown when a child is inserted with a parent not assigned to a tree .