def test_search_on_a_tree_containing_given_value_should_return_node_with_the_value(): object_under_test = BinarySearchTree() object_under_test.insert(8) result = object_under_test.search(8) assert result.value == 8
def test_searching_for_a_value_which_node_is_not_a_leaf_should_return_node_pointing_to_other_node(): object_under_test = BinarySearchTree() object_under_test.insert(2) object_under_test.insert(8) result = object_under_test.search(2) assert result.right.value == 8
def test_search_on_empty_tree_returns_none(): object_under_test = BinarySearchTree() assert object_under_test.search(8) is None