Skip to content

Commit 6c64bdf

Browse files
committed
refactor: simplify CSharpAnalyzerVerifier methods and property initializers for conciseness.
1 parent 69d5ba9 commit 6c64bdf

1 file changed

Lines changed: 3 additions & 7 deletions

File tree

src/ApiService/BookStore.ApiService.Analyzers.Tests/Verifiers/CSharpAnalyzerVerifier.cs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@ public static class CSharpAnalyzerVerifier<TAnalyzer>
1515
/// <summary>
1616
/// Verifies that the given source code produces no diagnostics
1717
/// </summary>
18-
public static async Task VerifyAnalyzerAsync(string source) =>
19-
await VerifyAnalyzerAsync(source, []);
18+
public static async Task VerifyAnalyzerAsync(string source) => await VerifyAnalyzerAsync(source, []);
2019

2120
/// <summary>
2221
/// Verifies that the given source code produces the expected diagnostics
@@ -35,13 +34,10 @@ public static async Task VerifyAnalyzerAsync(string source, params DiagnosticRes
3534
/// <summary>
3635
/// Helper to create a DiagnosticResult for a specific location
3736
/// </summary>
38-
public static DiagnosticResult Diagnostic(string diagnosticId) =>
39-
new(diagnosticId, DiagnosticSeverity.Warning);
37+
public static DiagnosticResult Diagnostic(string diagnosticId) => new(diagnosticId, DiagnosticSeverity.Warning);
4038

4139
class Test : CSharpAnalyzerTest<TAnalyzer, DefaultVerifier>
4240
{
43-
public Test() =>
44-
// Use the latest C# language version
45-
ReferenceAssemblies = ReferenceAssemblies.Net.Net90;
41+
public Test() => ReferenceAssemblies = ReferenceAssemblies.Net.Net90; // Use the latest C# language version
4642
}
4743
}

0 commit comments

Comments
 (0)