Visual Studio Version: VS2017
OS: W10
Test Framework: MSTest v2
I have the following test:
public abstract class UpdatableFieldTests<T> : GenericDealUpdatableFieldTests<T> where T : class, IUpdatableField
{
public static object[] InvalidDealTypes
{
get
{
var result=(from item in Enum.GetValues(typeof(DealType))
.OfType<DealType>()
where item != DealType.FixedFloat && item != DealType.FloatFloat
select new object[] { item }).ToArray();
return result;
}
}
[TestMethod]
[DynamicData(nameof(InvalidDealTypes))]
public void UserWithDealType_ForNonSwapDeals_ReturnsFalse(DealType dealType)
{
//Arrange
var field = GetTestInstance();
//Act
var result = field.UseWithDealType(dealType);
//Assert
Assert.IsFalse(result);
}
}
Other classes inherit from this base class and execute UserWithDealType_ForNonSwapDeals_ReturnsFalse. This worked fine for NCrunch 2.17 but is now breaking with:
System.InvalidOperationException: Late bound operations cannot be performed on types or methods for which ContainsGenericParameters is true.
at System.Reflection.RuntimeMethodInfo.ThrowNoInvokeException()
at System.Reflection.RuntimeMethodInfo.InvokeArgumentsCheck(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
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.Module.MSTest.Integration.MSTestDynamicDataSourceMethod.TryGetAllTestCaseParameters()
at nCrunch.Module.MSTest.Integration.MSTestTest.Run()