BinaryTreeTests.TreeNodeTests.Test_Enumirator_WithZeroSubtrees C# (CSharp) Method

Test_Enumirator_WithZeroSubtrees() private method

private Test_Enumirator_WithZeroSubtrees ( ) : void
return void
        public void Test_Enumirator_WithZeroSubtrees()
        {
            var node = new TreeNode<int>(5);
            var node2 = new TreeNode<int>(4);
            var firstTree = new NodeList<int>(1);
            firstTree[0] = node2;
            var nl = new NodeList<int>(0);
            node2.SubTrees = nl;
            node.SubTrees = firstTree;

            INode<int> expectedNode = null;
            foreach (var treeNode in node)
            {
                expectedNode = treeNode;
            }

            Assert.AreNotEqual(expectedNode, null);
            Assert.AreEqual(expectedNode.Data, 4);
        }