예제 #1
0
 private static DiagnosticResult Diagnostic <TAnalyzer>()
     where TAnalyzer : DiagnosticAnalyzer, new()
 => AnalyzerVerifier <TAnalyzer, CSharpAnalyzerTest <TAnalyzer>, DefaultVerifier> .Diagnostic();
        public void TestConstructionThroughVerifierActionableError2()
        {
            var error = Assert.Throws <InvalidOperationException>(() => AnalyzerVerifier <TwoDescriptorAnalyzer, CSharpAnalyzerTest <TwoDescriptorAnalyzer>, DefaultVerifier> .Diagnostic("ID"));

            Assert.Equal("'Diagnostic(string)' can only be used when the analyzer has a single supported diagnostic with the specified ID. Use the 'Diagnostic(DiagnosticDescriptor)' overload to specify the descriptor from which to create the expected result.", error.Message);
        }
 /// <inheritdoc cref="AnalyzerVerifier{TAnalyzer, TTest, TVerifier}.Diagnostic(DiagnosticDescriptor)"/>
 public static DiagnosticResult Diagnostic(DiagnosticDescriptor descriptor)
 => AnalyzerVerifier <TAnalyzer, TTest, TVerifier> .Diagnostic(descriptor);
 /// <inheritdoc cref="AnalyzerVerifier{TAnalyzer, TTest, TVerifier}.Diagnostic(string)"/>
 public static DiagnosticResult Diagnostic(string diagnosticId)
 => AnalyzerVerifier <TAnalyzer, TTest, TVerifier> .Diagnostic(diagnosticId);
 /// <inheritdoc cref="AnalyzerVerifier{TAnalyzer, TTest, TVerifier}.Diagnostic()"/>
 public static DiagnosticResult Diagnostic()
 => AnalyzerVerifier <TAnalyzer, TTest, TVerifier> .Diagnostic();
예제 #6
0
 private static DiagnosticResult Diagnostic()
 => AnalyzerVerifier <HighlightBracesAnalyzer, CSharpTest, DefaultVerifier> .Diagnostic();