diff --git a/src/Adapter/MSTest.TestAdapter/Discovery/AssemblyEnumerator.cs b/src/Adapter/MSTest.TestAdapter/Discovery/AssemblyEnumerator.cs index 35e195bc18..e810b570de 100644 --- a/src/Adapter/MSTest.TestAdapter/Discovery/AssemblyEnumerator.cs +++ b/src/Adapter/MSTest.TestAdapter/Discovery/AssemblyEnumerator.cs @@ -384,20 +384,24 @@ private static bool TryUnfoldITestDataSources(UnitTestElement test, TestMethodIn } } + if (tempListOfTests.Count > 0) + { + tests.AddRange(tempListOfTests); + } + return isDataDriven; } catch (Exception ex) { string message = string.Format(CultureInfo.CurrentCulture, Resource.CannotEnumerateIDataSourceAttribute, test.TestMethod.ManagedTypeName, test.TestMethod.ManagedMethodName, ex); PlatformServiceProvider.Instance.AdapterTraceLogger.LogInfo($"DynamicDataEnumerator: {message}"); - return false; - } - finally - { + if (tempListOfTests.Count > 0) { tests.AddRange(tempListOfTests); } + + return false; } }