@@ -234,6 +234,9 @@ private TestCase CreateTestCase(TestCaseDescriptor descriptor)
234234 var testCase = new TestCase (
235235 descriptor . FullyQualifiedName , descriptor . FullyQualifiedName , _executable , descriptor . DisplayName , "" , 0 ) ;
236236 testCase . Traits . AddRange ( GetFinalTraits ( descriptor . DisplayName , new List < Trait > ( ) ) ) ;
237+
238+ // Add the TestType for use in the executor when constructing the test key.
239+ testCase . Traits . Add ( new Trait ( nameof ( TestCaseDescriptor . TestType ) , descriptor . TestType . ToString ( ) ) ) ;
237240 return testCase ;
238241 }
239242
@@ -261,12 +264,19 @@ private TestCase CreateTestCase(TestCaseDescriptor descriptor, TestCaseLocation
261264 var testCase = new TestCase (
262265 descriptor . FullyQualifiedName , ns + descriptor . FullyQualifiedName , _executable , descriptor . DisplayName , location . Sourcefile , ( int ) location . Line ) ;
263266 testCase . Traits . AddRange ( GetFinalTraits ( descriptor . DisplayName , location . Traits ) ) ;
267+
268+ // Add the TestType for use in the executor when constructing the test key.
269+ testCase . Traits . Add ( new Trait ( nameof ( TestCaseDescriptor . TestType ) , descriptor . TestType . ToString ( ) ) ) ;
264270 return testCase ;
265271 }
266272
267- _logger . LogWarning ( String . Format ( Resources . LocationNotFoundError , descriptor . FullyQualifiedName ) ) ;
268- return new TestCase (
273+ var returnTest = new TestCase (
269274 descriptor . FullyQualifiedName , descriptor . FullyQualifiedName , _executable , descriptor . DisplayName , "" , 0 ) ;
275+
276+ // Add the TestType for use in the executor when constructing the test key.
277+ returnTest . Traits . Add ( new Trait ( nameof ( TestCaseDescriptor . TestType ) , descriptor . TestType . ToString ( ) ) ) ;
278+ _logger . LogWarning ( String . Format ( Resources . LocationNotFoundError , descriptor . FullyQualifiedName ) ) ;
279+ return returnTest ;
270280 }
271281
272282 internal static string GetTestSignatureNamespace ( string signature )
0 commit comments