示例#1
0
        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);
        }
示例#2
0
        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);
        }
示例#3
0
        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);
        }