public async Task TestFilterError() { var projects = GetProjects(); var allAnalyzers = await GetAnalyzersAsync(); var formattablePaths = ImmutableHashSet.Create(projects.First().Documents.First().FilePath); var minimumSeverity = DiagnosticSeverity.Error; var result = await AnalyzerFormatter.FilterBySeverityAsync( projects, allAnalyzers, formattablePaths, minimumSeverity, CancellationToken.None); var(_, analyzers) = Assert.Single(result); Assert.Empty(analyzers); }
public async Task TestFilterWarning() { var solution = GetSolution(); var projectAnalyzersAndFixers = await GetProjectAnalyzersAndFixersAsync(solution); var project = solution.Projects.First(); var formattablePaths = ImmutableHashSet.Create(project.Documents.First().FilePath); var minimumSeverity = DiagnosticSeverity.Warning; var result = await AnalyzerFormatter.FilterBySeverityAsync( solution, projectAnalyzersAndFixers, formattablePaths, minimumSeverity, CancellationToken.None); var(_, analyzers) = Assert.Single(result); Assert.Single(analyzers); }
public async Task TestFilterError() { var solution = await GetSolutionAsync(); var projectAnalyzersAndFixers = await GetProjectAnalyzersAndFixersAsync(solution); var project = solution.Projects.First(); var formattablePaths = ImmutableHashSet.Create(project.Documents.First().FilePath); var minimumSeverity = DiagnosticSeverity.Error; var diagnostics = ImmutableHashSet <string> .Empty; var result = await AnalyzerFormatter.FilterAnalyzersAsync( solution, projectAnalyzersAndFixers, formattablePaths, minimumSeverity, diagnostics, CancellationToken.None); var(_, analyzers) = Assert.Single(result); Assert.Empty(analyzers); }