Hi,
I also submitted a bug report (Using VS 2022 RC), so hopefully you have enough information to reproduce this issue on your side:
I want to test a method of a class that accepts a params enum array (params ScopeTypes[] scopeTypes).
As soon as I add this line to my test([DataRow(new ScopeTypes[0])]), NCrunch can no longer build the test assembly (I'm using the latest version of NCrunch (4.10.0.6), this happens in VS 2022 RC and VS 2019 latest version.
Here a very simple sample:
Code:
public enum ScopeTypes
{
Profitcenter,
ProductGroup
}
[TestClass]
public class Behaviour
{
[TestMethod]
[DataRow(null)]
[DataRow(new ScopeTypes[0])] // !! THIS CAUSES THE PROBLEM !!
public void DoSomething_Should_Accept_ParamsArray(ScopeTypes[] scopeTypes)
{
//arrange
ClassUnderTest classUnder = new ClassUnderTest();
//act
classUnder.DoSomething(scopeTypes);
//assert
Assert.IsTrue(true);
}
}
Working without the line:
[TestClass]
public class Behaviour
{
[TestMethod]
[DataRow(null)]
public void DoSomething_Should_Accept_ParamsArray(ScopeTypes[] scopeTypes)
{
//arrange
ClassUnderTest classUnder = new ClassUnderTest();
//act
classUnder.DoSomething(scopeTypes);
//assert
Assert.IsTrue(true);
}
}