AnalyzerUnitTest.ConnectedComponentCalculatorTest.TestCalculateStronglyConnectedComponents5 C# (CSharp) Method

TestCalculateStronglyConnectedComponents5() private method

private TestCalculateStronglyConnectedComponents5 ( ) : void
return void
        TestCalculateStronglyConnectedComponents5()
        {
            // One component with N vertices.

            const Int32 Vertices = 100;
            Int32[] aiVertexIDs = new Int32[Vertices];
            IVertex oFirstVertex = null;

            for (Int32 i = 0; i < Vertices; i++)
            {
                IVertex oVertex = m_oVertices.Add();
                aiVertexIDs[i] = oVertex.ID;

                if (i == 0)
                {
                    oFirstVertex = oVertex;
                }
                else
                {
                    m_oEdges.Add(oFirstVertex, oVertex);
                }
            }

            IList<LinkedList<IVertex>> oStronglyConnectedComponents =
                m_oConnectedComponentCalculator.
                CalculateStronglyConnectedComponents(m_oGraph, true);

            Assert.AreEqual(1, oStronglyConnectedComponents.Count);

            CheckThatComponentConsistsOfVertices(oStronglyConnectedComponents[0],
                 aiVertexIDs);
        }