def test__dfs_recursive__when_directed_graph_and_single_root__then_visited_visited(
         self):
     # when
     result = dfs_recursive(self._directed_graph, EmptyStrategy(),
                            [self._directed_graph.get_vertex(1)])
     # then
     assert_that(sorted(result)).is_equal_to([
         self._directed_graph.get_vertex(0),
         self._directed_graph.get_vertex(1),
         self._directed_graph.get_vertex(3),
         self._directed_graph.get_vertex(4),
         self._directed_graph.get_vertex(7)
     ])
 def test__dfs_recursive__when_directed_graph_and_many_roots__then_all_visited(
         self):
     # given
     strategy = self._TestingStrategy()
     # when
     result = dfs_recursive(self._directed_graph, strategy, [
         self._directed_graph.get_vertex(8),
         self._directed_graph.get_vertex(6)
     ])
     # then
     assert_that(sorted(result)).is_equal_to(
         sorted(self._directed_graph.vertices))
     assert_that(sorted(strategy.entries)).is_equal_to(
         sorted(self._undirected_graph.vertices))
     assert_that(sorted(strategy.exits)).is_equal_to(
         sorted(self._undirected_graph.vertices))
 def test__dfs_recursive__when_undirected_graph_and_no_roots__then_empty(
         self):
     # when
     result = dfs_recursive(self._undirected_graph, EmptyStrategy(), [])
     # then
     assert_that(list(result)).is_empty()