Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run and fail tests when ITestDataSource.GetData returns empty IEnumerable #2865

Merged
merged 19 commits into from
May 21, 2024
Merged
Prev Previous commit
Next Next commit
more,
fhnaseer committed May 21, 2024
commit ce58898203d03d8ee020fbb6e64f8c3ba1c20c14
Original file line number Diff line number Diff line change
@@ -305,7 +305,7 @@ private static bool ProcessTestDataSourceTests(UnitTestElement test, MethodInfo

if (!data.Any())
{
throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, FrameworkMessages.DynamicDataIEnumerableEmpty, "GetData", methodInfo.DeclaringType!.Name));
throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, FrameworkMessages.DynamicDataIEnumerableEmpty, "GetData", dataSource.GetType().Name));
}
}
catch (Exception ex) when (ex is ArgumentException && MSTestSettings.CurrentSettings.ConsiderEmptyDataSourceAsInconclusive)