protected async Task VerifyAnalyzerAsync(string source, params DiagnosticResult[] expected)
        {
            var testProject = new TestUnityProject <TAnalyzer>(expected.Select(w => w.Id).Distinct().ToArray());

            ShouldVerifyTest(testProject);
            ParseSource(testProject, source, expected);

            await testProject.RunAnalyzerAsync(CancellationToken.None);
        }
Ejemplo n.º 2
0
        protected async Task VerifyCodeFixAsync(string source, DiagnosticResult[] expected, string fixedSource)
        {
            var testProject = new TestUnityProject <TAnalyzer>(expected.Select(w => w.Id).Distinct().ToArray());

            ParseSource(testProject, source, expected);

            await testProject.RunAnalyzerAsync(CancellationToken.None);

            await testProject.RunCodeFixAsync <TCodeFix>(fixedSource, CancellationToken.None);
        }