Skip to content

Passing Array as test parameter fails with 4.5.0 #5129

@cbersch

Description

@cbersch

With release 4.5.0, passing Array as test parameter fails with
System.IndexOutOfRangeException : Index was outside the bounds of the array.

The following example works fine with 4.4.0, but breaks with 4.5.0:

public sealed class Class1
{
    private static IEnumerable<Array> Testcases
    {
        get
        {
            yield return new[] { 1, 2, 3 };
        }
    }

    [TestCaseSource(nameof(Testcases))]
    public void Foo(Array values)
    {
        Assert.That(values.Length, Is.EqualTo(3));
    }
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions