public void Remove_TheRightChildWithNoChildren_TheRootWithNoChildren()
        {
            var firstNode  = 2;
            var secondNode = 3;

            var bst = new BinarySearchTree <int, int>();

            bst.Insert(Key(firstNode), Value(firstNode));
            bst.Insert(Key(secondNode), Value(secondNode));

            bst.Remove(Key(secondNode));

            NodeAssert.NotNullAndEqual(bst.Root, Node(firstNode));
            NodeAssert.BothChildrenAreNull(bst.Root);
        }
        public void Remove_TheRootElementWithLeftChild_NewRootIsTheLeftChild()
        {
            var firstNode  = 2;
            var secondNode = 1;

            var bst = new BinarySearchTree <int, int>();

            bst.Insert(Key(firstNode), Value(firstNode));
            bst.Insert(Key(secondNode), Value(secondNode));

            bst.Remove(Key(firstNode));

            NodeAssert.NotNullAndEqual(bst.Root, Node(secondNode));
            NodeAssert.BothChildrenAreNull(bst.Root);
        }
        public void Remove_TheRootFromAThreeLevelTree_TheCorrectTree()
        {
            var firstNode = Node(9);
            var rootNode  = ComplexTree.RootElement;
            var bst       = ComplexTree.Create();

            bst.Remove(firstNode.Key);
            bst.Remove(rootNode.Key);

            NodeAssert.NotNullAndEqual(bst.Root, Node(10));
            NodeAssert.BothChildrenAreNotNull(bst.Root);

            NodeAssert.NotNullAndEqual(bst.Root.Right, Node(12));
            NodeAssert.BothChildrenAreNotNull(bst.Root.Right);
            NodeAssert.BothChildrenAreNull(bst.Root.Right.Left);
            NodeAssert.BothChildrenAreNotNull(bst.Root.Right.Right);

            NodeAssert.NotNullAndEqual(bst.Root.Left, Node(4));
            NodeAssert.BothChildrenAreNotNull(bst.Root.Left);
            NodeAssert.BothChildrenAreNotNull(bst.Root.Left.Left);
            NodeAssert.BothChildrenAreNotNull(bst.Root.Left.Right);
        }