Added test cases to check the new interfaces of WeightedGraph.