Hi,
I have an MSTest parameterized test where the data rows use enumeration values, but the test method uses an integer (because the test method covers multiple int-based enumerations). NCrunch can't seem to coerce the enumeration value from the data row annotation to an integer despite that being the base type of the enumeration and the Resharper and MSTest runners working fine and able to run these tests. The error reported by NCrunch is:
Quote:Type mismatch on test parameter 1 (System.Int32 != EnumTest+TestEnum)
* NCrunch v5.6.0.1
* NCrunch has MSTest is configured to UseDynamicAnalysis
* MSTest.TestAdapter and MSTest.TestFramework are using v2.2.8
* Casting the enumeration value to an integer in the data row annotation works around the problem
Minimal reproduction shown below:
Code:
[TestClass]
public sealed class EnumTest
{
[TestMethod]
[DataRow(TestEnum.Value1)]
[DataRow(TestEnum.Value2)]
[DataRow(TestEnum.Value3)]
[DataRow(OtherTestEnum.OtherValue1)]
[DataRow(OtherTestEnum.OtherValue2)]
public void ParameterisedTest(int enumerationValue)
{
}
private enum TestEnum
{
Value1,
Value2,
Value3
}
private enum OtherTestEnum
{
OtherValue1,
OtherValue2
}
}
Is this an issue that could be addressed in NCrunch without the workarounds described above?