public void ConvertToMatrix(int id, int n, int m, bool isDirected, Type expectedType)
        {
            //Arrange
            var converter = new AdjListToMatrixConverter();
            var net = BasicAdjListGenerator.GenerateAdjListWithDataAttribs(n, m, isDirected, true, true);

            //Act
            var mtrx = converter.ConvertToMatrix(net);

            //Assert
            Assert.NotNull(mtrx);
            Assert.IsType(expectedType, mtrx);
            Assert.Equal(net.IsDirected, mtrx.IsDirected);
            Assert.Equal(net.NodeCount, mtrx.NodeCount);
            int sum = -2;
            if (net.IsDirected)
                sum = (int)mtrx.SumRegion(MatrixRegion.All);
            else
            {
                double upper = mtrx.SumRegion(MatrixRegion.UpperTriangle);
                double diag = mtrx.SumRegion(MatrixRegion.Diagonal);
                sum = (int)upper + (int)diag;
            }
            Assert.Equal(net.EdgeCount, sum);
        }
        public void ConvertToMatrix_VerifyNonEdges(int id, int n, int m, bool isDirected, Type expectedType)
        {
            //Arrange
            var converter = new AdjListToMatrixConverter();
            var net = BasicAdjListGenerator.GenerateAdjListWithDataAttribs(n, m, isDirected, true, true);

            var dic = new Dictionary<Point, int>();
            Point p;
            foreach (IEdge edge in net.Edges)
            {
                p = new Point(edge.SourceNode.Index, edge.DestinationNode.Index);
                if (!dic.ContainsKey(p))
                    dic.Add(p, 1);
                else
                    dic[p]++;
            }

            var mtrx = converter.ConvertToMatrix(net);

            bool doesNotContain = false;
            for (int i = 0; i < mtrx.NodeCount; i++ )
            {
                for (int j = 0; j < mtrx.NodeCount; j++)
                {
                    if(mtrx[i,j] == 0.0)
                    {
                        p = new Point(i, j);
                        doesNotContain = dic.ContainsKey(p);
                        Assert.False(doesNotContain);
                    }
                }
            }
        }
        public void ConvertToMatrix_VerifyEdges(int id, int n, int m, bool isDirected, Type expectedType)
        {
            //Arrange
            var converter = new AdjListToMatrixConverter();
            var net = BasicAdjListGenerator.GenerateAdjListWithDataAttribs(n, m, isDirected, true, true);

            //Act
            var mtrx = converter.ConvertToMatrix(net);

            //Assert
            INode srcNode = null;
            INode destNode = null;
            int i=0;
            int j=0;
            double val = 0.0;

            foreach (IEdge edge in net.Edges)
            {
                srcNode = edge.SourceNode;
                destNode = edge.DestinationNode;
                i = srcNode.Index;
                j = destNode.Index;
                val = mtrx[i, j];
                Assert.NotEqual(0.0, val);
            }
        }