Beispiel #1
0
        public void GetAdjacencyListTest()
        {
            WeightedDiGraph <int> directedGraph = GetTestGraph();

            ICollection <WeightedEdge <int> > adjacencyList = directedGraph.GetAdjacencyList(0);

            Assert.AreEqual(3, adjacencyList.Count, "Adjacency list count");
            Assert.IsTrue(adjacencyList.Contains(new WeightedEdge <int>(0, 1, 10)));
            Assert.IsTrue(adjacencyList.Contains(new WeightedEdge <int>(0, 2, 5)));
            Assert.IsTrue(adjacencyList.Contains(new WeightedEdge <int>(0, 3, 3)));
        }