Пример #1
0
        public void Given_DirectedGraph_When_HaveVerticesAndEdgesWithVaryingWeights_Then_ReturnCorrectMetadata(
            GraphType type, EdgeDescriptor <int>[] edges, int vertexCount, int edgeCount, bool disconnected,
            bool weighted, bool negativeWeights)
        {
            // Arrange
            var graph = new AdjacencySetGraph <int>(type);

            graph.AddToGraph(edges);

            // Act
            var result = Sut.GetMetadata(graph);

            // Assert
            Assert.Equal(type, result.Type);
            Assert.Equal(vertexCount, result.VerticesCount);
            Assert.Equal(edgeCount, result.EdgeCount);
            Assert.Equal(disconnected, result.Disconnected);
            Assert.Equal(weighted, result.Weighted);
            Assert.Equal(negativeWeights, result.HasNegativeWeights);
        }