add unit test for DirectedGraph