Ejemplo n.º 1
0
        public void Detach_not_set_node_must_not_throw_an_expetion()
        {
            var root = new BinaryTreeSpec(1);

            root.DetachLeftNode();
            root.DetachRightNode();

            Assert.IsFalse(root.HasLeft);
        }
Ejemplo n.º 2
0
        public void Detach_left_node_must_clear_relationship_in_both_ways()
        {
            var root = new BinaryTreeSpec(1);
            var left = new BinaryTreeSpec(2);

            root.SetLeft(left);
            root.DetachLeftNode();

            Assert.IsFalse(root.HasLeft);
            Assert.IsTrue(left.IsRoot);
        }