@@ -25,17 +25,17 @@ internal static TestCase ToVsTestCase(this BenchmarkCase benchmarkCase, string a
25
25
{
26
26
var benchmarkMethod = benchmarkCase . Descriptor . WorkloadMethod ;
27
27
var fullClassName = benchmarkCase . Descriptor . Type . GetCorrectCSharpTypeName ( ) ;
28
- var benchmarkMethodName = benchmarkCase . Descriptor . WorkloadMethod . Name ;
29
- var benchmarkFullMethodName = $ "{ fullClassName } .{ benchmarkMethodName } ";
30
-
31
- // Display name has arguments as well.
32
- var displayMethodName = FullNameProvider . GetMethodName ( benchmarkCase ) ;
33
- if ( includeJobInName )
34
- displayMethodName += $ " [{ benchmarkCase . GetUnrandomizedJobDisplayInfo ( ) } ]";
28
+ var parametrizedMethodName = FullNameProvider . GetMethodName ( benchmarkCase ) ;
35
29
30
+ var displayJobInfo = benchmarkCase . GetUnrandomizedJobDisplayInfo ( ) ;
31
+ var displayMethodName = parametrizedMethodName + ( includeJobInName ? $ " [{ displayJobInfo } ]" : "" ) ;
36
32
var displayName = $ "{ fullClassName } .{ displayMethodName } ";
37
33
38
- var vsTestCase = new TestCase ( benchmarkFullMethodName , VsTestAdapter . ExecutorUri , assemblyPath )
34
+ // We use displayName as FQN to workaround the Rider/R# problem with FQNs processing
35
+ // See: https://github.com/dotnet/BenchmarkDotNet/issues/2494
36
+ var fullyQualifiedName = displayName ;
37
+
38
+ var vsTestCase = new TestCase ( fullyQualifiedName , VsTestAdapter . ExecutorUri , assemblyPath )
39
39
{
40
40
DisplayName = displayName ,
41
41
Id = GetTestCaseId ( benchmarkCase )
@@ -67,7 +67,8 @@ internal static TestCase ToVsTestCase(this BenchmarkCase benchmarkCase, string a
67
67
internal static string GetUnrandomizedJobDisplayInfo ( this BenchmarkCase benchmarkCase )
68
68
{
69
69
var jobDisplayInfo = benchmarkCase . Job . DisplayInfo ;
70
- if ( ! benchmarkCase . Job . HasValue ( CharacteristicObject . IdCharacteristic ) && benchmarkCase . Job . ResolvedId . StartsWith ( "Job-" , StringComparison . OrdinalIgnoreCase ) )
70
+ if ( ! benchmarkCase . Job . HasValue ( CharacteristicObject . IdCharacteristic ) &&
71
+ benchmarkCase . Job . ResolvedId . StartsWith ( "Job-" , StringComparison . OrdinalIgnoreCase ) )
71
72
{
72
73
// Replace Job-ABCDEF with Job
73
74
jobDisplayInfo = "Job" + jobDisplayInfo . Substring ( benchmarkCase . Job . ResolvedId . Length ) ;
@@ -91,4 +92,4 @@ internal static Guid GetTestCaseId(this BenchmarkCase benchmarkCase)
91
92
return testIdProvider . GetId ( ) ;
92
93
}
93
94
}
94
- }
95
+ }
0 commit comments