Skip to content

Commit

Permalink
Fix compliation errors in Testing README sample custom verifier
Browse files Browse the repository at this point in the history
  • Loading branch information
MattKotsenas committed Jun 21, 2024
1 parent 6eb4858 commit 5947d6e
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions src/Microsoft.CodeAnalysis.Testing/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ use of "basic use cases" for test scenarios that would otherwise be considered a
public static class CSharpAnalyzerVerifier<TAnalyzer>
where TAnalyzer : DiagnosticAnalyzer, new()
{
public static DiagnosticResult Diagnostic(string diagnosticId = null)
public static DiagnosticResult Diagnostic(string diagnosticId)
=> CSharpAnalyzerVerifier<TAnalyzer, DefaultVerifier>.Diagnostic(diagnosticId);

public static DiagnosticResult Diagnostic(DiagnosticDescriptor descriptor)
Expand All @@ -217,7 +217,7 @@ public static class CSharpAnalyzerVerifier<TAnalyzer>

// Code fix tests support both analyzer and code fix testing. This test class is derived from the code fix test
// to avoid the need to maintain duplicate copies of the customization work.
public class Test : CSharpCodeFixVerifier.Test<TAnalyzer, EmptyCodeFixProvider>
public class Test : CSharpCodeFixVerifier<TAnalyzer, EmptyCodeFixProvider>.Test
{
}
}
Expand All @@ -226,7 +226,7 @@ public static class CSharpCodeFixVerifier<TAnalyzer, TCodeFix>
where TAnalyzer : DiagnosticAnalyzer, new()
where TCodeFix : CodeFixProvider, new()
{
public static DiagnosticResult Diagnostic(string diagnosticId = null)
public static DiagnosticResult Diagnostic(string diagnosticId)
=> CSharpCodeFixVerifier<TAnalyzer, TCodeFix, DefaultVerifier>.Diagnostic(diagnosticId);

public static DiagnosticResult Diagnostic(DiagnosticDescriptor descriptor)
Expand Down Expand Up @@ -258,17 +258,13 @@ public static class CSharpCodeFixVerifier<TAnalyzer, TCodeFix>
}

public class Test : CSharpCodeFixTest<TAnalyzer, TCodeFix, DefaultVerifier>
where TAnalyzer : DiagnosticAnalyzer, new()
where TCodeFix : CodeFixProvider, new()
{
public CSharpCodeFixTest()
public Test()
{
// Custom initialization logic here
}

// Custom analyzers and/or code fix properties here
}
}

```

0 comments on commit 5947d6e

Please sign in to comment.