コード例 #1
0
        public void AddEdgeTest()
        {
            MatrixRepresentation listRepresentation = new MatrixRepresentation(5);

            listRepresentation.AddEdge(new Edge(1, 2, 5));
            listRepresentation.AddEdge(new Edge(3, 1, 5));
            if (listRepresentation.Edges != 2)
            {
                Assert.Fail();
            }
        }
コード例 #2
0
        public void GetEdgesTest()
        {
            MatrixRepresentation listRepresentation = new MatrixRepresentation(5);

            listRepresentation.AddEdge(new Edge(1, 2, 5));
            listRepresentation.AddEdge(new Edge(3, 1, 5));
            listRepresentation.AddEdge(new Edge(1, 3, 5));
            listRepresentation.AddEdge(new Edge(1, 4, 5));
            if (listRepresentation.GetEdges(1).Count != 3)
            {
                Assert.Fail();
            }
        }