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

Overloaded test method is not recognized #2859

Closed
schibu007 opened this issue May 16, 2024 · 2 comments
Closed

Overloaded test method is not recognized #2859

schibu007 opened this issue May 16, 2024 · 2 comments

Comments

@schibu007
Copy link

Describe the bug

Overloaded test methods (attributed with [TestMethod]) are not recognized by MSTest and are therefor silently ignored.

Steps To Reproduce

Consider following class:

[TestClass]
public sealed class Tests
{
    [TestMethod]
    public void Test() { }

    [TestMethod]
    [DataRow(123)]
    public void Test(int arg) { }
}

When you execute them in VS, you'll get this result:
image

Note, that the result of the overloaded test method Test(int arg) is missing.

Expected behavior

Either the overloaded test method should be recognized/executed, or an analyzer should prevent test method overloading.

Actual behavior

The overloaded test method is not recognized by MSTest.

@Evangelink
Copy link
Member

Overloads are currently not supported in MSTest. I was pretty sure we had a similar request but I cannot find it back.

I'll keep this ticket open as feature request to either add support for it or add an analyzer.

@schibu007
Copy link
Author

@Evangelink thanks for the fast response. Based on your answer I searched again and found this issue 1235. I guess you could close this issue then as a duplicate.

@schibu007 schibu007 closed this as not planned Won't fix, can't repro, duplicate, stale May 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants