@@ -25,17 +25,17 @@ internal static TestCase ToVsTestCase(this BenchmarkCase benchmarkCase, string a
2525 {
2626 var benchmarkMethod = benchmarkCase . Descriptor . WorkloadMethod ;
2727 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 ) ;
3529
30+ var displayJobInfo = benchmarkCase . GetUnrandomizedJobDisplayInfo ( ) ;
31+ var displayMethodName = parametrizedMethodName + ( includeJobInName ? $ " [{ displayJobInfo } ]" : "" ) ;
3632 var displayName = $ "{ fullClassName } .{ displayMethodName } ";
3733
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 )
3939 {
4040 DisplayName = displayName ,
4141 Id = GetTestCaseId ( benchmarkCase )
@@ -67,7 +67,8 @@ internal static TestCase ToVsTestCase(this BenchmarkCase benchmarkCase, string a
6767 internal static string GetUnrandomizedJobDisplayInfo ( this BenchmarkCase benchmarkCase )
6868 {
6969 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 ) )
7172 {
7273 // Replace Job-ABCDEF with Job
7374 jobDisplayInfo = "Job" + jobDisplayInfo . Substring ( benchmarkCase . Job . ResolvedId . Length ) ;
@@ -91,4 +92,4 @@ internal static Guid GetTestCaseId(this BenchmarkCase benchmarkCase)
9192 return testIdProvider . GetId ( ) ;
9293 }
9394 }
94- }
95+ }
0 commit comments