Closed ReinventorOfWheels closed 4 years ago
This isn't a bug in the library. It's a nuance of how C# does params
attributes. If you pass null
in for a params
attribute, instead of turning that into new object[] { null }
, C# just passes in null
itself. The attribute rejects a null
array today because it wants an array of objects.
So this works fine:
[Theory]
[CombinatorialData]
public void CombinatorialBug(
[CombinatorialValues(1, 2, 3)] int paramA,
[CombinatorialValues(new object[] { null })] string paramB)
{ }
That said, we can probably re-interpret a null
array as an array with a single null
element to make this easier.
Hello I'm very happy with this package, but I found a bug. This code does not produce a combination of 3 tests as expected:
while this works correctly
and this too (6 tests)