Skip to content

NUnit1001 - false positive for arguments with generic parameters #922

@PiotrKlecha

Description

@PiotrKlecha

Test values for arguments with generic parameters are incorrectly reported as unassignable, even when they actually match, e.g.:

[Test]
[TestCase(arg: new[] { 1, 2, 3, })]
[TestCase(arg: new[] { "a", "b", "c", })]
[TestCase(arg: new[] { typeof(int), typeof(string), typeof(double), })]
[TestCase(arg: new[] { 1ul, 2ul, 3ul, })]
public void TestCollectionMethod<T>(IEnumerable<T> collection)
{
	// ... test
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions