Esempio n. 1
0
 def test_vertices_returns_proper_set(self):
     graph = WeightedGraph()
     graph.AddVertex(1)
     graph.AddVertex(2)
     graph.AddVertex(3)
     expected_result = [1, 2, 3]
     self.assertEqual(list(graph.Vertices()), expected_result)
Esempio n. 2
0
 def test_has_vertex_returns_proper_result(self):
     graph = WeightedGraph()
     graph.AddVertex(42)
     self.assertTrue(graph.HasVertex(42))
Esempio n. 3
0
 def test_set_vertex_is_added_to_graph(self):
     graph = WeightedGraph()
     expected_result = [42]
     graph.AddVertex(42)
     self.assertEqual(list(graph.Vertices()), expected_result)