Skip to content

[Arguments(arg1, arg2, arg3)] fails to execute with default arguments since v0.50.0 #2780

@AlexandreBossard

Description

@AlexandreBossard

I use to have:

    [Arguments(2, 2)]
    [Arguments(20, 3, Operation.Kind.A)]
    [Arguments(20, 6, Operation.Kind.Deposit, Operation.Kind.B)]
    public async Task GetOperations(int dayDelta, int expectedNumberOfOperation, params Operation.Kind[] kinds)
{
}

which compile and execute find with 0.25.21. Now I have the following runtime errors:

failed GetOperations(2, 2) (0ms)
  Expected exactly 3 arguments, but got 2

I admit the code is a bit fishy, but it used to work.
Also trying to fix it with an empty list like so

[Arguments(2, 2, new Operation.Kind[] { })]

does not compile

TUnit.Core.SourceGenerator.Generators.TestMetadataGenerator/FormattedOperationBuilderTests_GetOperations_4696c0823acd456480148379fcc70338.g.cs(32,119): error CS7000: Unexpected use of an aliased name

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions