-
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
Data-driven tests are not fully supported for overloaded test methods #1253
Comments
Hi @drieseng, Thanks for reporting this! I have just tested and can reproduce the issue you are seeing. I have also tested with |
I cannot find any mention that supports the fact this is a supported feature and testing a few older versions I cannot see it ever working so I will consider this as a feature request! |
@Evangelink, the fact that these are silenty ignored can hardly be considered ok. Perhaps there's no documentation that indicates it is supported, but there's also no document that says it isn't. If support this overloaded methods is added, I suppose the signature (parameter types) of the overload should be included in the name of the test method. For example:
To decide whether you'd want to mention the type name with or without namespace, or - when available - the C# keyword. |
I understand that the behavior of silently ignoring is not ideal and should be fixed but detecting and raising some warning for this case is going to take the same time as actually implementing this request. Besides, I am not saying we cannot support it. Actually, it's the opposite and that's why I flagged this as new feature. Depending on the progresses we make with the scope of what needs to be done for 2.3.0, we may add it there, otherwise for sure it will be part of our v3 roadmap. And again, thanks for reporting this problem! We are actively working on improving overall experience of MSTest users. |
@Evangelink, if you can point me in the right direction (and if you've decided how such overloaded test methods should be reported), I can try to take a stab at this. |
I really appreciate that you are offering some help here! We are currently refactoring the way we produce the test ID because it is broken for datasources, I hope that he fix will either make this feature directly supported or easy to add. Because of that, I would like to avoid having you working for nothing (or have to redo everything you did after our change). If that's ok with you, I'll ping you here once our fix is available so you can start working on it. |
Hey @drieseng, test ID feature is merged and I am done with the first pass of big refactorings. Let me know if you are still interested and I will try to find the place where the change would be needed. |
@Evangelink: sure, I'd be happy to help. |
Awesome, I'll get back to you early next week (or during weekend) with where you could start! |
Are there any updates on this issue? |
I am not sure why I didn't get back to @drieseng so let me start by apologizing! As for the update, not really but I think that should not be too complex to add that support so I'll plan it for 3.6 (we are already loaded for 3.5). |
From the symptoms it looks like there will be some key on the method name, but not on methodname+parameters. |
Description
The MSTest V2 test framework does not appear to correctly support overloaded data-driven test methods.
Only tests for the first overload are actually found and executed.
Steps to reproduce
Compile and execute the unit tests in the following code fragment:
Expected behavior
The test results in both Visual Studio and the console runner report 4 tests: two for the
Equal(int x, string x)
overload and two for theEqual(string x, int x)
overload. For each of these overloads, one test should pass, and one should fail.Actual behavior
Only the results for the
Equal(int x, string x)
overload are reported in Test Explorer:Running
dotnet test -t --nologo --no-restore --no-build
also finds only two tests:Running
dotnet test --nologo --no-restore --no-build
only executes two tests:Environment
The text was updated successfully, but these errors were encountered: