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

Do not require member type in [DynamicData] when member is defined on base class #4347

Open
Evangelink opened this issue Dec 13, 2024 · 0 comments

Comments

@Evangelink
Copy link
Member

Summary

Make usage as simple as possible when member info can be inferred.

Background and Motivation

The use case below should be simplified:

public class Base
{
    public static IEnumerable<object[]> GetData() => yield return new object[] { 1 };
}

[TestClass]
public class MyTest : Base
{
    [TestMethod]
    [DynamicData(nameof(GetData), DynamicDataSourceType.Method)] // MSTEST0018 + error at runtime
    public void M(int i) {}
}

Proposed Feature

Do not require the typeof when we know the member is part of the class (through inheritance).

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

1 participant