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

MSTEST0014 false positive with arrays. #2856

Closed
Mertsch opened this issue May 15, 2024 · 2 comments
Closed

MSTEST0014 false positive with arrays. #2856

Mertsch opened this issue May 15, 2024 · 2 comments

Comments

@Mertsch
Copy link
Contributor

Mertsch commented May 15, 2024

Describe the bug

[TestMethod]
#pragma warning disable CA1861 // Avoid constant arrays as arguments
[DataRow(new int[] { })]
[DataRow(new int[] { 11 })]
[DataRow(new int[] { 11, 1337, 12 })]
#pragma warning restore CA1861
public void ItemsTest(int[] input)
{
    // Test Code
}

Produces: MSTEST0014: DataRow argument type should match method parameter type. Mismatches occur at indices: (0, 0)

Expected behavior

Should be accepted as valid since input is an array

Additional context

2024-05-15 14-53-15 devenv

AB#2058804

@Evangelink
Copy link
Member

Hi @Mertsch,

Thanks for the bug report. I can confirm that I can reproduce the issue. I am still working on a fix for MSTest v3.4 so I am adding this one too.

@testplatform-bot
Copy link
Contributor

✅ Successfully linked to Azure Boards work item(s):

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

3 participants