Ejemplo n.º 1
0
 public static AzureAnalyzerTest <TAnalyzer> WithSources <TAnalyzer>(this AzureAnalyzerTest <TAnalyzer> test, params string[] sources)
     where TAnalyzer : DiagnosticAnalyzer, new()
 {
     foreach (var source in sources)
     {
         test.TestState.Sources.Add(source);
     }
     return(test);
 }
        public static Task VerifyAnalyzerAsync(string source, params DiagnosticResult[] diagnostics)
        {
            var test = new AzureAnalyzerTest <TAnalyzer>
            {
                TestCode      = source,
                TestBehaviors = TestBehaviors.SkipGeneratedCodeCheck
            };

            test.ExpectedDiagnostics.AddRange(diagnostics);
            return(test.RunAsync(CancellationToken.None));
        }
Ejemplo n.º 3
0
 public static AzureAnalyzerTest <TAnalyzer> WithDisabledDiagnostics <TAnalyzer>(this AzureAnalyzerTest <TAnalyzer> test, params string[] diagnostics)
     where TAnalyzer : DiagnosticAnalyzer, new()
 {
     test.DisabledDiagnostics.AddRange(diagnostics);
     return(test);
 }