1 write to Descriptor
Microsoft.CodeAnalysis.Test.Utilities (1)
Diagnostics\CommonDiagnosticAnalyzers.cs (1)
1057Descriptor = new DiagnosticDescriptor(
55 references to Descriptor
Microsoft.CodeAnalysis.CSharp.CommandLine.UnitTests (11)
CommandLineTests.cs (11)
13066Assert.Contains($"warning {analyzer.Descriptor.Id}", output, StringComparison.Ordinal); 13070var suppressor = new DiagnosticSuppressorForId(analyzer.Descriptor.Id); 13075analyzer.Descriptor.MessageFormat, 13084Assert.DoesNotContain($"warning {analyzer.Descriptor.Id}", output, StringComparison.Ordinal); 13093Assert.Contains($"error {analyzer.Descriptor.Id}", output, StringComparison.Ordinal); 13102Assert.DoesNotContain($"warning {analyzer.Descriptor.Id}", output, StringComparison.Ordinal); 13108suppressor = new DiagnosticSuppressorForId(analyzer.Descriptor.Id); 13113Assert.Contains($"warning {analyzer.Descriptor.Id}", output, StringComparison.Ordinal); 13133Assert.Contains($"error {analyzer.Descriptor.Id}", output, StringComparison.Ordinal); 13136var suppressor = new DiagnosticSuppressorForId(analyzer.Descriptor.Id); 13141Assert.Contains($"error {analyzer.Descriptor.Id}", output, StringComparison.Ordinal);
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (29)
Diagnostics\DiagnosticSuppressorTests.cs (29)
235Diagnostic(analyzer.Descriptor.Id, source1, isSuppressed: false).WithLocation(1, 1), 236Diagnostic(analyzer.Descriptor.Id, source2, isSuppressed: false).WithLocation(1, 1), 240var analyzersAndSuppressors = new DiagnosticAnalyzer[] { analyzer, new DiagnosticSuppressorForId(analyzer.Descriptor.Id) }; 242Diagnostic(analyzer.Descriptor.Id, source1, isSuppressed: true).WithLocation(1, 1), 243Diagnostic(analyzer.Descriptor.Id, source2, isSuppressed: true).WithLocation(1, 1), 257var expectedDiagnostic = Diagnostic(analyzer.Descriptor.Id, source, isSuppressed: false).WithLocation(1, 1); 261expectedDiagnostic = Diagnostic(analyzer.Descriptor.Id, source, isSuppressed: true).WithLocation(1, 1); 262var analyzersAndSuppressors = new DiagnosticAnalyzer[] { analyzer, new DiagnosticSuppressorForId(analyzer.Descriptor.Id), new DiagnosticSuppressorForId(analyzer.Descriptor.Id) }; 267analyzersAndSuppressors = new DiagnosticAnalyzer[] { analyzer, new DiagnosticSuppressorForId(analyzer.Descriptor.Id, suppressionId: "SPR0001"), new DiagnosticSuppressorForId(analyzer.Descriptor.Id, suppressionId: "SPR0002") }; 284Diagnostic(analyzer.Descriptor.Id, source)); 287var suppressor2 = new DiagnosticSuppressorForId(analyzer.Descriptor.Id); 292Diagnostic(analyzer.Descriptor.Id, source, isSuppressed: true)); 305var expectedDiagnostic = Diagnostic(analyzer.Descriptor.Id, source, isSuppressed: false); 309var analyzersAndSuppressors = new DiagnosticAnalyzer[] { analyzer, new DiagnosticSuppressorForId(analyzer.Descriptor.Id, suppressionId) }; 310expectedDiagnostic = Diagnostic(analyzer.Descriptor.Id, source, isSuppressed: true); 355var suppressor = new DiagnosticSuppressorForId(analyzer.Descriptor.Id); 360key: analyzer.Descriptor.Id, 434var suppressor = new DiagnosticSuppressorThrowsExceptionFromReportedSuppressions(analyzer.Descriptor.Id, expectedException); 480var suppressor = new DiagnosticSuppressor_UnsupportedSuppressionReported(analyzer.Descriptor.Id, supportedSuppressionId, unsupportedSuppressionId); 533var suppressor = new DiagnosticSuppressor_InvalidDiagnosticSuppressionReported(analyzer.Descriptor.Id, unsupportedSuppressedId); 537var exceptionMessage = string.Format(CodeAnalysisResources.InvalidDiagnosticSuppressionReported, analyzer.Descriptor.Id, unsupportedSuppressedId); 586var suppressor = new DiagnosticSuppressor_NonReportedDiagnosticCannotBeSuppressed(analyzer.Descriptor.Id, nonReportedDiagnosticId); 635var expectedDiagnostic = Diagnostic(analyzer.Descriptor.Id, source); 639var suppressor = new DiagnosticSuppressorForId(analyzer.Descriptor.Id, suppressionId); 650var suppressor2 = new DiagnosticSuppressorForId(analyzer.Descriptor.Id, suppressionId2); 675var expectedDiagnostic = Diagnostic(analyzer.Descriptor.Id, source); 678var suppressor = new DiagnosticSuppressorForId_ThrowsOperationCancelledException(analyzer.Descriptor.Id);
Microsoft.CodeAnalysis.EditorFeatures2.UnitTests (2)
Diagnostics\DiagnosticServiceTests.vb (2)
2135Assert.Equal(analyzer.Descriptor.Id, descriptors.Single().Id) 2154Assert.Equal(analyzer.Descriptor.Id, hiddenDiagnostics.Single().Id)
Microsoft.CodeAnalysis.Test.Utilities (2)
Diagnostics\CommonDiagnosticAnalyzers.cs (2)
1069public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics => ImmutableArray.Create(Descriptor); 1081context.ReportDiagnostic(Diagnostic.Create(Descriptor, tree.GetRoot().GetLocation()));
Microsoft.CodeAnalysis.VisualBasic.CommandLine.UnitTests (11)
CommandLineTests.vb (11)
9902Assert.Contains($"warning {analyzer.Descriptor.Id}", output, StringComparison.Ordinal) 9906Dim suppressor = New DiagnosticSuppressorForId(analyzer.Descriptor.Id) 9911analyzer.Descriptor.MessageFormat, 9919Assert.DoesNotContain($"warning {analyzer.Descriptor.Id}", output, StringComparison.Ordinal) 9928Assert.Contains($"error {analyzer.Descriptor.Id}", output, StringComparison.Ordinal) 9936Assert.DoesNotContain($"warning {analyzer.Descriptor.Id}", output, StringComparison.Ordinal) 9942suppressor = New DiagnosticSuppressorForId(analyzer.Descriptor.Id) 9947Assert.Contains($"warning {analyzer.Descriptor.Id}", output, StringComparison.Ordinal) 9967Assert.Contains($"error {analyzer.Descriptor.Id}", output, StringComparison.Ordinal) 9970Dim suppressor = New DiagnosticSuppressorForId(analyzer.Descriptor.Id) 9975Assert.Contains($"error {analyzer.Descriptor.Id}", output, StringComparison.Ordinal)