@@ -687,7 +687,7 @@ private MethodInfo GetMethodInfoForTestMethod(TestMethod testMethod, TestClassIn
687687
688688 private static MethodInfo ? GetMethodInfoUsingManagedNameHelper ( TestMethod testMethod , TestClassInfo testClassInfo , bool discoverInternals )
689689 {
690- MethodBase ? methodBase = null ;
690+ MethodInfo ? testMethodInfo = null ;
691691 try
692692 {
693693 // testMethod.MethodInfo can be null if 'TestMethod' instance crossed app domain boundaries.
@@ -696,24 +696,12 @@ private MethodInfo GetMethodInfoForTestMethod(TestMethod testMethod, TestClassIn
696696 // In addition, it also happens when deployment items are used and app domain is disabled.
697697 // We explicitly set it to null in this case because the original MethodInfo calculated during discovery cannot be used because
698698 // it points to the type loaded from the assembly in bin instead of from deployment directory.
699- methodBase = testMethod . MethodInfo ?? ManagedNameHelper . GetMethod ( testClassInfo . Parent . Assembly , testMethod . ManagedTypeName ! , testMethod . ManagedMethodName ! ) ;
699+ testMethodInfo = testMethod . MethodInfo ?? ManagedNameHelper . GetMethod ( testClassInfo . Parent . Assembly , testMethod . ManagedTypeName ! , testMethod . ManagedMethodName ! ) ;
700700 }
701701 catch ( InvalidManagedNameException )
702702 {
703703 }
704704
705- MethodInfo ? testMethodInfo = null ;
706- if ( methodBase is MethodInfo mi )
707- {
708- testMethodInfo = mi ;
709- }
710- else if ( methodBase != null )
711- {
712- Type [ ] parameters = [ .. methodBase . GetParameters ( ) . Select ( i => i . ParameterType ) ] ;
713- // TODO: Should we pass true for includeNonPublic?
714- testMethodInfo = PlatformServiceProvider . Instance . ReflectionOperations . GetRuntimeMethod ( methodBase . DeclaringType ! , methodBase . Name , parameters , includeNonPublic : true ) ;
715- }
716-
717705 return testMethodInfo is null
718706 || ! testMethodInfo . HasCorrectTestMethodSignature ( true , discoverInternals )
719707 ? null
0 commit comments