JetBrains / JetBrains/TeamCity.VSTest.TestAdapter
Unable to retrieve test parameters from parameterized xunit tests
- Dominant language
- C#
- Stars
- 32
- Forks
- 13
- PR merge metrics
- No merged PRs in 30d
Description
xunit works correctly when the test parameter has a primitive type - string, int, etc. These parameters are displayed in the _displayName_ attribute:
```c#
[Theory]
[MemberData(nameof(GetParameters1))]
public void Parametrized1(string param1, int param2)
{
}
public static IEnumerable GetParameters1()
{
for (var i = 0; i < 1; i++)
{
yield return new object[]
{
$"Abc {i}",
i
};
}
}
```

If at least one of the attributes is not of primitive type, all parameters disappear from _displayName_:
```c#
[Theory]
[MemberData(nameof(GetParameters2))]
public void Parametrized2(string param1, int param2, IReadOnlyCollection param3)
{
}
public static IEnumerable GetParameters2()
{
for (var i = 0; i < 1; i++)
{
yield return new object[]
{
$"Abc {i}",
i,
ImmutableArray.Create(
new Data2("str 1", 33),
new Data2("str 2", 99))
};
}
}
public record Data2(string StrVal, double DoubleVal);
```

It would be useful to add a resultDisplayName attribute that contains the correct value - with all parameters. For example, this is necessary for correct generation of allure test reports
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.