Rank: Advanced Member
Groups: Registered
Joined: 10/28/2014(UTC) Posts: 139 Location: United Kingdom
Thanks: 7 times Was thanked: 18 time(s) in 16 post(s)
|
See https://github.com/Matth...les/NullableEnumDataRow for a repro If you create a DataRow test with enum values and null is an acceptable value then NCrunch fails to run the test with a stack trace similar to the following Quote:System.ArgumentException: Object of type 'System.Int32' cannot be converted to type 'System.Nullable`1[NullableEnumDataRow.CountryCode]'. at System.RuntimeType.TryChangeType(Object value, Binder binder, CultureInfo culture, Boolean needsSpecialCast) at System.RuntimeType.CheckValue(Object value, Binder binder, CultureInfo culture, BindingFlags invokeAttr) at System.Reflection.MethodBase.CheckArguments(StackAllocedArguments& stackArgs, ReadOnlySpan`1 parameters, Binder binder, BindingFlags invokeAttr, CultureInfo culture, Signature sig) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters) at nCrunch.TestExecution.Reflection.Clr.ClrMethod.Invoke(Object instance, Object[] parameters)
The Visual Studio test runner has no problems with these tests and runs / reports on them fine
|