// Helpers
 private static string GetDisplayString(ITypeSymbol type, IEnumerable <ITypeSymbol> types)
 {
     return(string.Format(
                "{0}: {1}",
                RoslynDisplayUtils.GetDisplayString(type),
                types.Join(RoslynDisplayUtils.GetDisplayString)
                ));
 }
        public void Test_05_DependenciesAnalysis_Analyze()
        {
            var compilation = CodeAnalysisTestingUtils.CreateFakeCompilation().LoadDocuments("TestData_DependenciesAnalysis.cs");

            var(root, model) = compilation.FindDocument();

            var analysis = DependenciesAnalyzer.Analyze(root, model);

            TestContext.WriteLine(RoslynDisplayUtils.GetDisplayString(root, analysis));
        }
        public void Test_02_ControlFlowGraph()
        {
            var compilation = CodeAnalysisTestingUtils.CreateFakeCompilation().LoadDocuments("TestData_ControlFlowGraph.cs");

            var(method, model) = compilation.FindDocument().FindMethod("ControlFlowGraphExample");

            var graph   = ControlFlowGraph.Create(method, model) ?? throw new Exception("Control flow graph is null");
            var message = RoslynDisplayUtils.GetDisplayString(graph);

            TestContext.WriteLine(message);
        }