Exemple #1
0
        public void TestAllConversions()
        {
            GraphMatrix matrix   = createRandomGraph(50);
            GraphMatrix original = createCopy(matrix);

            matrix = Converter.ConvertToMatrix(Converter.ConvertToMatrixInc(Converter.ConvertToList(matrix)));

            for (int y = 0; y < original.NodesNr; ++y)
            {
                for (int x = 0; x < original.NodesNr; ++x)
                {
                    bool orig = original.GetConnection(x, y);
                    bool conv = matrix.GetConnection(x, y);

                    Assert.IsTrue(orig == conv);
                }
            }
        }