Does anybody know how to use xUnit with "Theory" and "InlineData" with enum
values? This here is leading to the tests not being recognized as tests and not run:
[Theory]
[InlineData("12h", 12, PeriodUnit.Hour)]
[InlineData("3d", 3, PeriodUnit.Day)]
[InlineData("1m", 1, PeriodUnit.Month)]
public void ShouldParsePeriod(string periodString, int value, PeriodUnit periodUnit)
{
var period = Period.Parse(periodString);
period.Value.Should().Be(value);
period.PeriodUnit.Should().Be(periodUnit);
}
The tests work and run if I use the int values of the enum instead of the enum values.