Skip to content

When submitting only part of optional parameters, all are overriden by defaults #1640

@ParanoikCZE

Description

@ParanoikCZE

When there is more than one optional parameter in test method, submitting only some of them via TestCase attribute leads into overriding them all by defaults.

observed in: 3.2.1, 3.4.0

STR:
[TestCase(1,1)]
public void Test(int expected, int p1 = 0, int p2 = 0)
{
if (p1 + p2 != expected) Assert.Fail();
}

ER: p1 will use submitted value, p2 will use default => test pass

AR: p1 and p2 uses default values => test fail

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions