Example #1
0
        public void TestSuccessor()
        {
            Assert.AreEqual(tree.Nil, tree.Successor(tree.Maximum(tree.Root)));
            Assert.AreSame(tree.Nil, tree.Successor(tree.Maximum(tree.Root)));

            Assert.AreEqual(tree.Root.Right.Left, tree.Successor(tree.Root));
            Assert.AreSame(tree.Root.Right.Left, tree.Successor(tree.Root));

            Assert.AreEqual(tree.Root.Right.Right, tree.Successor(tree.Root.Right));
            Assert.AreSame(tree.Root.Right.Right, tree.Successor(tree.Root.Right));
        }