@@ -59,8 +59,8 @@ private TestResult CreateTestResult(int indexOfTestcase)
5959 int currentLineIndex = indexOfTestcase ;
6060
6161 string line = _consoleOutput [ currentLineIndex ++ ] ;
62- string testDisplayName = RemovePrefix ( line ) . Trim ( ) ;
63- TestCase testCase = FindTestcase ( testDisplayName ) ;
62+ string qualifiedTestname = RemovePrefix ( line ) . Trim ( ) ;
63+ TestCase testCase = FindTestcase ( qualifiedTestname ) ;
6464 if ( testCase == null )
6565 {
6666 _logger . DebugWarning ( String . Format ( Resources . NoKnownTestCaseMessage , line ) ) ;
@@ -189,14 +189,31 @@ private int FindIndexOfNextTestcase(int currentIndex)
189189 return - 1 ;
190190 }
191191
192- private TestCase FindTestcase ( string testDisplayName )
192+ private TestCase FindTestcase ( string qualifiedTestname )
193193 {
194- return FindTestcase ( testDisplayName , _testCasesRun ) ;
194+ return FindTestcase ( qualifiedTestname , _testCasesRun ) ;
195195 }
196196
197- public static TestCase FindTestcase ( string testDisplayName , IList < TestCase > testCasesRun )
197+ public static TestCase FindTestcase ( string qualifiedTestname , IList < TestCase > testCasesRun )
198198 {
199- return testCasesRun . SingleOrDefault ( tc => tc . DisplayName == testDisplayName ) ;
199+ foreach ( TestCase tc in testCasesRun )
200+ {
201+ // If namespace exists then remove it so we can compare the test display names.
202+ // Using just tc.DisplayName does not work for paramaterized test cases.
203+ string fullyQualifiedName = tc . FullyQualifiedName ;
204+ int frequency = fullyQualifiedName . Where ( x => ( x == '.' ) ) . Count ( ) ;
205+ if ( frequency > 1 )
206+ {
207+ fullyQualifiedName = fullyQualifiedName . Substring ( fullyQualifiedName . IndexOf ( '.' ) + 1 ) ;
208+ }
209+
210+ if ( fullyQualifiedName == qualifiedTestname )
211+ {
212+ return tc ;
213+ }
214+ }
215+
216+ return null ;
200217 }
201218
202219 public static bool IsRunLine ( string line )
0 commit comments