public async Task VerifyRefactoringAsync( string theory, string fromData, string toData, string equivalenceKey = null, CodeVerificationOptions options = null, CancellationToken cancellationToken = default(CancellationToken)) { (TextSpan span, string source, string expected) = SpanParser.ReplaceEmptySpan(theory, fromData, toData); TextSpanParserResult result = SpanParser.GetSpans(source, reverse: true); if (result.Spans.Any()) { await VerifyRefactoringAsync( source : result.Text, expected : expected, spans : result.Spans.Select(f => f.Span), equivalenceKey : equivalenceKey, options : options, cancellationToken : cancellationToken).ConfigureAwait(false); } else { await VerifyRefactoringAsync( source : source, expected : expected, span : span, equivalenceKey : equivalenceKey, options : options, cancellationToken : cancellationToken).ConfigureAwait(false); } }
public async Task VerifyDiagnosticAsync( string source, CodeVerificationOptions options = null, CancellationToken cancellationToken = default(CancellationToken)) { SpanParserResult result = SpanParser.GetSpans(source); await VerifyDiagnosticAsync( result.Text, result.Spans.Select(f => CreateDiagnostic(f.Span, f.LineSpan)), additionalSources : null, options : options, cancellationToken).ConfigureAwait(false); }
public async Task VerifyNoRefactoringAsync( string source, string equivalenceKey = null, CodeVerificationOptions options = null, CancellationToken cancellationToken = default(CancellationToken)) { TextSpanParserResult result = SpanParser.GetSpans(source, reverse: true); await VerifyNoRefactoringAsync( source : result.Text, spans : result.Spans.Select(f => f.Span), equivalenceKey : equivalenceKey, options : options, cancellationToken : cancellationToken).ConfigureAwait(false); }
public async Task VerifyDiagnosticAsync( string theory, string fromData, CodeVerificationOptions options = null, CancellationToken cancellationToken = default(CancellationToken)) { (TextSpan span, string text) = SpanParser.ReplaceSpan(theory, fromData); SpanParserResult result = SpanParser.GetSpans(text); if (result.Spans.Any()) { await VerifyDiagnosticAsync(result.Text, result.Spans.Select(f => f.Span), options, cancellationToken).ConfigureAwait(false); } else { await VerifyDiagnosticAsync(text, span, options, cancellationToken).ConfigureAwait(false); } }