-
Notifications
You must be signed in to change notification settings - Fork 269
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
Allow IEnumerable of tuple for DynamicData source #2226
Conversation
To avoid breaking public API, we decided to convert the tuple in `object[]` to preserve it. The current solution relies on `ITuple` which is only available in NET471+. Given we currently target net462 for full framework, that means that the feature will only be available for netcore. I'll weigh the benefit/cost ratio of adding net471 build in the package so this feature can be available more widely.
I think it makes sense.
|
Not entirely sure to get the issue you are describing. Do you have some example?
Yes, I think it makes sense as alternative, see #2227. We did something similar in TATF, it's also making it easier to provide custom name for each entry if we want.
|
namespace TestProject74
{
[TestClass]
public class UnitTest1
{
[DynamicData(nameof(GetData))]
[TestMethod]
public void TestMethod1((string file, string mode) t)
{
Console.WriteLine(t.file);
}
public IEnumerable<object[]> GetData()
{
return new[]
{
new object[] { (file: "aaa.txt", mode: "write") }
};
}
}
} |
I expect that this would still work from what I have seen but I will add a test to ensure that's the case. Thanks! |
I have done some manual testing and we are good. I won't add integration test here because we will need to rewrite our integration suite to allow this test and I would prefer to postpone this change for a different PR. |
To avoid breaking public API, we decided to convert the tuple in
object[]
to preserve it. The current solution relies onITuple
which is only available in NET471+. Given we currently target net462 for full framework, that means that the feature will only be available for netcore. I'll weigh the benefit/cost ratio of adding net471 buildin the package so this feature can be available more widely.
Fixes #1335 and fixes #1624