You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Feature]: Method Data Source: Match functionality of IEnumerable<TestDataRow<Func<>>> with IEnumerable<Func<>> #6161
Currently, when using Method Data Sources, you can return an IEnumerable<Func<(int, int, int)>> or IEnumerable<Func<CustomTestDataClass>> and a test method consumes it by ingesting the data through the parameter (i.e. TestMethod(int a, int b, int c) or TestMethod(CustomTestDataClass data)) with no issue.
However, when using this with IEnumerable<TestDataRow<(int, int, int)>>, you must consume it by TestMethod(Func<(int, int, int)> dataFunction). This is fine when running the tests, you just have to assign the result of invoking the function. The issue is when using the parameterized DisplayName of the TestDataRow, the parameters do not match, since the parameter is the function.
Proposed Solution
I would like to be able to define the data source as:
Actually, while writing more test cases, the current implementation does pose a problem. Since the DisplayName does not replace the parameters, the test runner believes they are the same tests, and runs the first one as many times as the DisplayName is the same.
Activity
ska737 commentedon Jun 5, 2026
Actually, while writing more test cases, the current implementation does pose a problem. Since the
DisplayNamedoes not replace the parameters, the test runner believes they are the same tests, and runs the first one as many times as theDisplayNameis the same.+semver:minor - fix: invoke inner Func for TestDataRow<Func<T>> data …