Skip to content

Commit c18a417

Browse files
committed
Unify C# language version
1 parent e0bd1d6 commit c18a417

File tree

12 files changed

+1378
-1411
lines changed

12 files changed

+1378
-1411
lines changed

src/BenchmarkDotNet.Analyzers/BenchmarkDotNet.Analyzers.Tests/AnalyzerTests/Attributes/ArgumentsAttributeAnalyzerTests.cs

Lines changed: 255 additions & 254 deletions
Large diffs are not rendered by default.

src/BenchmarkDotNet.Analyzers/BenchmarkDotNet.Analyzers.Tests/AnalyzerTests/Attributes/GeneralParameterAttributesAnalyzerTests.cs

Lines changed: 361 additions & 374 deletions
Large diffs are not rendered by default.

src/BenchmarkDotNet.Analyzers/BenchmarkDotNet.Analyzers.Tests/AnalyzerTests/Attributes/ParamsAllValuesAttributeAnalyzerTests.cs

Lines changed: 126 additions & 106 deletions
Large diffs are not rendered by default.

src/BenchmarkDotNet.Analyzers/BenchmarkDotNet.Analyzers.Tests/AnalyzerTests/Attributes/ParamsAttributeAnalyzerTests.cs

Lines changed: 118 additions & 173 deletions
Large diffs are not rendered by default.

src/BenchmarkDotNet.Analyzers/BenchmarkDotNet.Analyzers.Tests/AnalyzerTests/BenchmarkRunner/RunAnalyzerTests.cs

Lines changed: 76 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -19,27 +19,29 @@ public async Task Invoking_with_type_argument_class_having_only_one_and_public_m
1919
{
2020
const string classWithOneBenchmarkMethodName = "ClassWithOneBenchmarkMethod";
2121

22-
var testCode =
23-
/* lang=c#-test */ $@"using BenchmarkDotNet.Running;
24-
25-
public class Program
26-
{{
27-
public static void Main(string[] args) {{
28-
BenchmarkRunner.Run<{classWithOneBenchmarkMethodName}>();
29-
}}
30-
}}";
31-
32-
var benchmarkClassDocument =
33-
/* lang=c#-test */ $@"using BenchmarkDotNet.Attributes;
34-
35-
public class {classWithOneBenchmarkMethodName}
36-
{{
37-
[Benchmark]
38-
public void BenchmarkMethod()
39-
{{
40-
41-
}}
42-
}}";
22+
var testCode = /* lang=c#-test */ $$"""
23+
using BenchmarkDotNet.Running;
24+
25+
public class Program
26+
{
27+
public static void Main(string[] args) {
28+
BenchmarkRunner.Run<{{classWithOneBenchmarkMethodName}}>();
29+
}
30+
}
31+
""";
32+
33+
const string benchmarkClassDocument = /* lang=c#-test */ $$"""
34+
using BenchmarkDotNet.Attributes;
35+
36+
public class {{classWithOneBenchmarkMethodName}}
37+
{
38+
[Benchmark]
39+
public void BenchmarkMethod()
40+
{
41+
42+
}
43+
}
44+
""";
4345

4446
TestCode = testCode;
4547
AddSource(benchmarkClassDocument);
@@ -52,24 +54,26 @@ public async Task Invoking_with_type_argument_class_having_no_public_method_anno
5254
{
5355
const string classWithOneBenchmarkMethodName = "ClassWithOneBenchmarkMethod";
5456

55-
var testCode =
56-
/* lang=c#-test */ $@"using BenchmarkDotNet.Running;
57-
58-
public class Program
59-
{{
60-
public static void Main(string[] args) {{
61-
BenchmarkRunner.Run<{{|#0:{classWithOneBenchmarkMethodName}|}}>();
62-
}}
63-
}}";
64-
65-
var benchmarkClassDocument =
66-
/* lang=c#-test */ $@"public class {classWithOneBenchmarkMethodName}
67-
{{
68-
public void BenchmarkMethod()
69-
{{
70-
71-
}}
72-
}}";
57+
const string testCode = /* lang=c#-test */ $$"""
58+
using BenchmarkDotNet.Running;
59+
60+
public class Program
61+
{
62+
public static void Main(string[] args) {
63+
BenchmarkRunner.Run<{|#0:{{classWithOneBenchmarkMethodName}}|}>();
64+
}
65+
}
66+
""";
67+
68+
const string benchmarkClassDocument = /* lang=c#-test */ $$"""
69+
public class {{classWithOneBenchmarkMethodName}}
70+
{
71+
public void BenchmarkMethod()
72+
{
73+
74+
}
75+
}
76+
""";
7377
TestCode = testCode;
7478
AddSource(benchmarkClassDocument);
7579
AddDefaultExpectedDiagnostic(classWithOneBenchmarkMethodName);
@@ -82,37 +86,39 @@ public async Task Invoking_with_type_argument_class_having_at_least_one_public_m
8286
{
8387
const string classWithOneBenchmarkMethodName = "ClassWithOneBenchmarkMethod";
8488

85-
var testCode =
86-
/* lang=c#-test */ $@"using BenchmarkDotNet.Running;
87-
88-
public class Program
89-
{{
90-
public static void Main(string[] args) {{
91-
BenchmarkRunner.Run<{classWithOneBenchmarkMethodName}>();
92-
}}
93-
}}";
94-
95-
var benchmarkClassDocument =
96-
/* lang=c#-test */ $@"using BenchmarkDotNet.Attributes;
97-
98-
public class {classWithOneBenchmarkMethodName}
99-
{{
100-
[Benchmark]
101-
public void BenchmarkMethod()
102-
{{
103-
104-
}}
105-
106-
public void BenchmarkMethod2()
107-
{{
108-
109-
}}
110-
111-
private void BenchmarkMethod3()
112-
{{
113-
114-
}}
115-
}}";
89+
const string testCode = /* lang=c#-test */ $$"""
90+
using BenchmarkDotNet.Running;
91+
92+
public class Program
93+
{
94+
public static void Main(string[] args) {
95+
BenchmarkRunner.Run<{{classWithOneBenchmarkMethodName}}>();
96+
}
97+
}
98+
""";
99+
100+
const string benchmarkClassDocument = /* lang=c#-test */ $$"""
101+
using BenchmarkDotNet.Attributes;
102+
103+
public class {{classWithOneBenchmarkMethodName}}
104+
{
105+
[Benchmark]
106+
public void BenchmarkMethod()
107+
{
108+
109+
}
110+
111+
public void BenchmarkMethod2()
112+
{
113+
114+
}
115+
116+
private void BenchmarkMethod3()
117+
{
118+
119+
}
120+
}
121+
""";
116122

117123
TestCode = testCode;
118124
AddSource(benchmarkClassDocument);

0 commit comments

Comments
 (0)