public void ElevenEdgesTest() { var fileLocation = @"..\..\TestData\11Edges.txt"; var edges = GetEdges(fileLocation).ToList(); var nodesById = GetNodes(edges); var graphAlgo = new KosarajuSccByRecur(); //Act graphAlgo.Run(nodesById.Values); //Assert var result = nodesById.Values.GroupBy(node => node.SCCNumber).Take(5); var expected = new List <int>() { 3, 3, 3 }; CollectionAssert.AreEqual(expected, result.Select(grp => grp.Count()).ToList()); }
public void TenEdgesTest() { var fileLocation = @"..\..\TestData\10Edges.txt"; var edges = GetEdges(fileLocation).ToList(); var nodesById = GetNodes(edges); var graphAlgo = new KosarajuSccByRecur(); //Act graphAlgo.Run(nodesById.Values); //Assert var result = nodesById.Values.GroupBy(node => node.SCCNumber).Take(5); var expected = new List <int>() { 4, 3, 3, 1 }; CollectionAssert.AreEqual(expected, result.Select(grp => grp.Count()).OrderByDescending(num => num).ToList()); //foreach (var group in result) //{ // Console.WriteLine($"Member count: {group.Count()}"); //} }