public void TestSetup() { solution = CompilationHelper.GetSolutionFromText(Source); compilation = solution.Projects.First().GetCompilationAsync().Result; syntaxTree = compilation.SyntaxTrees.First(); }
public void TestSetup() { solution = CompilationHelper.GetSolutionFromText(Source); compilation = solution.Projects.First().GetCompilationAsync().Result; syntaxTree = compilation.SyntaxTrees.First(); ifMethod = syntaxTree.GetRoot().DescendantNodes().OfType <MethodDeclarationSyntax>().First(m => m.Identifier.ValueText == "IfMethod"); switchMethod = syntaxTree.GetRoot().DescendantNodes().OfType <MethodDeclarationSyntax>().First(m => m.Identifier.ValueText == "SwitchMethod"); }
public void TestSetup() { solution = CompilationHelper.GetSolutionFromText(Source); compilation = solution.Projects.First().GetCompilationAsync().Result; syntaxTree = compilation.SyntaxTrees.First(); semanticModel = compilation.GetSemanticModel(syntaxTree); methods = syntaxTree.GetRoot().DescendantNodes().OfType <MethodDeclarationSyntax>().ToList(); }
public void DiagnosticRunnerTest_NoAnalyzer() { var runner = new DiagnosticsRunner(ImmutableArray.Create <DiagnosticAnalyzer>()); var solution = CompilationHelper.GetSolutionFromText(""); var compilation = solution.Projects.First().GetCompilationAsync().Result; var diagnosticsResult = runner.GetDiagnostics(compilation); diagnosticsResult.Should().HaveCount(0); }