Пример #1
0
        public void check_that_it_contain_value()
        {
            //Arrange
            BinarySearchTree <int> tree = new BinarySearchTree <int>();

            //act
            tree.AddNodeToTree(5);
            tree.AddNodeToTree(1);
            tree.AddNodeToTree(7);

            Assert.False(tree.Contain(9));
        }
Пример #2
0
        public void can_Add_to_Single_root_node()
        {
            //Arrange
            BinarySearchTree <int> tree = new BinarySearchTree <int>();

            //assert
            tree.AddNodeToTree(5);
            tree.AddNodeToTree(1);
            tree.AddNodeToTree(7);

            Assert.NotNull(tree.Root.Left);
            Assert.NotNull(tree.Root.Right);
        }
Пример #3
0
        public void can_Add_to_empty()
        {
            //Arrange
            BinarySearchTree <int> tree = new BinarySearchTree <int>();


            //assert
            Assert.Null(tree.Root);
            tree.AddNodeToTree(5);
            Assert.NotNull(tree);
        }