示例#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);
        }
示例#2
0
        public void Detach_right_node_must_clear_relationship_in_both_ways()
        {
            var root  = new BinaryTreeSpec(1);
            var right = new BinaryTreeSpec(3);

            root.SetRigth(right);
            root.DetachRightNode();

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