src/Workspaces/CoreTest/SolutionTests/ProjectDependencyGraphTests.cs
/// <summary>
/// Verifies that <see cref="ProjectDependencyGraph.GetTopologicallySortedProjects(CancellationToken)"/> 
/// returns one of the correct results.
/// </summary>
/// <param name="solution"></param>
/// <param name="expectedResults">A list of possible results. Because topological sorting is ambiguous
/// in that a graph could have multiple topological sorts, this helper lets you give all the possible
/// results and it asserts that one of them does match.</param>
Verifies that
returns one of the correct results.
Verifies that returns one of the correct results .
private void VerifyTopologicalSort(Solution solution, params string[] expectedResults)
        {
            var projectDependencyGraph = solution.GetProjectDependencyGraph();
            var projectIds = projectDependencyGraph.GetTopologicallySortedProjects(CancellationToken.None);
            var actualResult = string.Concat(projectIds.Select(id => solution.GetProject(id).AssemblyName));
            Assert.Contains<string>(actualResult, expectedResults);
        }
private void VerifyTopologicalSort ( Solution solution , params string [ ] expectedResults ) { var projectDependencyGraph = solution . GetProjectDependencyGraph ( ) ; var projectIds = projectDependencyGraph . GetTopologicallySortedProjects ( CancellationToken . None ) ; var actualResult = string . Concat ( projectIds . Select ( id => solution . GetProject ( id ) . AssemblyName ) ) ; Assert . Contains < string > ( actualResult , expectedResults ) ; }
Verifies that
returns one of the correct results.
Verifies that returns one of the correct results .
solution
Solution
None
expectedResults
A list of possible results. Because topological sorting is ambiguous
in that a graph could have multiple topological sorts, this helper lets you give all the possible
results and it asserts that one of them does match.
A list of possible results . Because topological sorting is ambiguous in that a graph could have multiple topological sorts this helper lets you give all the possible results and it asserts that one of them does match .