@@ -25,6 +25,8 @@ namespace TestHelper
2525 /// </summary>
2626 public abstract partial class CodeFixVerifier : DiagnosticVerifier
2727 {
28+ private const int DefaultNumberOfIncrementalIterations = - 1000 ;
29+
2830 /// <summary>
2931 /// Returns the code fix being tested (C#) - to be implemented in non-abstract class.
3032 /// </summary>
@@ -46,7 +48,7 @@ public abstract partial class CodeFixVerifier : DiagnosticVerifier
4648 /// value is less than 0, the negated value is treated as an upper limit as opposed to an exact value.</param>
4749 /// <param name="cancellationToken">The <see cref="CancellationToken"/> that the task will observe.</param>
4850 /// <returns>A <see cref="Task"/> representing the asynchronous operation.</returns>
49- protected async Task VerifyCSharpFixAsync ( string oldSource , string newSource , string batchNewSource = null , int ? codeFixIndex = null , bool allowNewCompilerDiagnostics = false , int numberOfIncrementalIterations = - int . MaxValue , int numberOfFixAllIterations = 1 , CancellationToken cancellationToken = default ( CancellationToken ) )
51+ protected async Task VerifyCSharpFixAsync ( string oldSource , string newSource , string batchNewSource = null , int ? codeFixIndex = null , bool allowNewCompilerDiagnostics = false , int numberOfIncrementalIterations = DefaultNumberOfIncrementalIterations , int numberOfFixAllIterations = 1 , CancellationToken cancellationToken = default ( CancellationToken ) )
5052 {
5153 var t1 = this . VerifyFixInternalAsync ( LanguageNames . CSharp , this . GetCSharpDiagnosticAnalyzers ( ) . ToImmutableArray ( ) , this . GetCSharpCodeFixProvider ( ) , new [ ] { oldSource } , new [ ] { newSource } , codeFixIndex , allowNewCompilerDiagnostics , numberOfIncrementalIterations , GetSingleAnalyzerDocumentAsync , cancellationToken ) . ConfigureAwait ( false ) ;
5254
@@ -108,7 +110,7 @@ public abstract partial class CodeFixVerifier : DiagnosticVerifier
108110 /// value is less than 0, the negated value is treated as an upper limit as opposed to an exact value.</param>
109111 /// <param name="cancellationToken">The <see cref="CancellationToken"/> that the task will observe.</param>
110112 /// <returns>A <see cref="Task"/> representing the asynchronous operation.</returns>
111- protected async Task VerifyCSharpFixAsync ( string [ ] oldSources , string [ ] newSources , string [ ] batchNewSources = null , int ? codeFixIndex = null , bool allowNewCompilerDiagnostics = false , int numberOfIncrementalIterations = - int . MaxValue , int numberOfFixAllIterations = 1 , CancellationToken cancellationToken = default ( CancellationToken ) )
113+ protected async Task VerifyCSharpFixAsync ( string [ ] oldSources , string [ ] newSources , string [ ] batchNewSources = null , int ? codeFixIndex = null , bool allowNewCompilerDiagnostics = false , int numberOfIncrementalIterations = DefaultNumberOfIncrementalIterations , int numberOfFixAllIterations = 1 , CancellationToken cancellationToken = default ( CancellationToken ) )
112114 {
113115 var t1 = this . VerifyFixInternalAsync ( LanguageNames . CSharp , this . GetCSharpDiagnosticAnalyzers ( ) . ToImmutableArray ( ) , this . GetCSharpCodeFixProvider ( ) , oldSources , newSources , codeFixIndex , allowNewCompilerDiagnostics , numberOfIncrementalIterations , GetSingleAnalyzerDocumentAsync , cancellationToken ) . ConfigureAwait ( false ) ;
114116
0 commit comments