Skip to content

Commit

Permalink
Remove unusable verifier methods
Browse files Browse the repository at this point in the history
  • Loading branch information
sharwell committed Jan 13, 2021
1 parent cf45877 commit 63833b4
Showing 1 changed file with 0 additions and 42 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using System.Threading;
using System.Threading.Tasks;

namespace Microsoft.CodeAnalysis.Testing
{
/// <summary>
Expand All @@ -18,44 +15,5 @@ public class SourceGeneratorVerifier<TSourceGenerator, TTest, TVerifier>
where TTest : SourceGeneratorTest<TVerifier>, new()
where TVerifier : IVerifier, new()
{
/// <summary>
/// Verifies the application of the source generator produces the expected result.
/// </summary>
/// <param name="source">The source text to test. Any diagnostics are defined in markup.</param>
/// <param name="fixedSource">The expected fixed source text. Any remaining diagnostics are defined in markup.</param>
/// <returns>A <see cref="Task"/> representing the asynchronous operation.</returns>
public static Task VerifySourceGeneratorAsync(string source, string fixedSource)
=> VerifySourceGeneratorAsync(source, DiagnosticResult.EmptyDiagnosticResults, fixedSource);

/// <summary>
/// Verifies the application of the source generator produces the expected result.
/// </summary>
/// <param name="source">The source text to test, which may include markup syntax.</param>
/// <param name="expected">The expected diagnostic. This diagnostic is in addition to any diagnostics defined in
/// markup.</param>
/// <param name="fixedSource">The expected fixed source text. Any remaining diagnostics are defined in markup.</param>
/// <returns>A <see cref="Task"/> representing the asynchronous operation.</returns>
public static Task VerifySourceGeneratorAsync(string source, DiagnosticResult expected, string fixedSource)
=> VerifySourceGeneratorAsync(source, new[] { expected }, fixedSource);

/// <summary>
/// Verifies the application of the source generator produces the expected result.
/// </summary>
/// <param name="source">The source text to test, which may include markup syntax.</param>
/// <param name="expected">The expected diagnostics. These diagnostics are in addition to any diagnostics
/// defined in markup.</param>
/// <param name="fixedSource">The expected fixed source text. Any remaining diagnostics are defined in markup.</param>
/// <returns>A <see cref="Task"/> representing the asynchronous operation.</returns>
public static Task VerifySourceGeneratorAsync(string source, DiagnosticResult[] expected, string fixedSource)
{
var test = new TTest
{
TestCode = source,
FixedCode = fixedSource,
};

test.ExpectedDiagnostics.AddRange(expected);
return test.RunAsync(CancellationToken.None);
}
}
}

0 comments on commit 63833b4

Please sign in to comment.