using Microsoft.CodeAnalysis.CodeRefactorings; using Microsoft.CodeAnalysis.Testing; using System.Threading; using System.Threading.Tasks; namespace Misaki.HighPerformance.Analyzer.Test { public static partial class VisualBasicCodeRefactoringVerifier where TCodeRefactoring : CodeRefactoringProvider, new() { /// public static async Task VerifyRefactoringAsync(string source, string fixedSource) { await VerifyRefactoringAsync(source, DiagnosticResult.EmptyDiagnosticResults, fixedSource); } /// public static async Task VerifyRefactoringAsync(string source, DiagnosticResult expected, string fixedSource) { await VerifyRefactoringAsync(source, new[] { expected }, fixedSource); } /// public static async Task VerifyRefactoringAsync(string source, DiagnosticResult[] expected, string fixedSource) { var test = new Test { TestCode = source, FixedCode = fixedSource, }; test.ExpectedDiagnostics.AddRange(expected); await test.RunAsync(CancellationToken.None); } } }