public void CreateUndirectedEdges_Creates_WeightMap_When_IncludeEdgeData_Is_True(int n, int m) { //Arrange var converter = new MatrixToAdjListConverter(); var srcMtrx = BasicMatrixGenerator.GenerateMatrix(n, m, false); var targetNet = BasicAdjListGenerator.GenerateAdjListWithDataAttribs(n, 0, true, true, true); converter.IncludeEdgeData = true; converter.CreateUndirectedEdges(srcMtrx, targetNet); Assert.NotNull(converter.EdgeToEdgeWeightMap); Assert.Equal(srcMtrx.EdgeCount, converter.EdgeToEdgeWeightMap.Count); }
public void CreateUndirectedEdges_CreatesZeroEdgesWhenNodeCountsDoNotMatch(int n, int m) { //Arrange var converter = new MatrixToAdjListConverter(); var srcMtrx = BasicMatrixGenerator.GenerateMatrix(n, m, false); var targetNet = BasicAdjListGenerator.GenerateAdjListWithDataAttribs(n+1, 0, false, true, true); Assert.Equal(0, targetNet.EdgeCount); converter.CreateUndirectedEdges(srcMtrx, targetNet); Assert.Equal(0, targetNet.EdgeCount); }