You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
context.Setup(
() => Utilities.ApplyDivisors( It.IsAny<double>(), It.IsAny<IEnumerable<IDivisor>>() ) )
.Returns<double, IEnumerable<IDivisor>>( ( a, b ) => { return a; } );
When executing a Static method that calls ApplyDivisors I get the following exception:
System.InvalidCastException: Object must implement IConvertible.
at System.Convert.ChangeType(Object value, Type conversionType, IFormatProvider provider)
at Smocks.Setups.Setup1.<>c__DisplayClass2_02.b__0(Object[] args)
at Smocks.Setups.Setup1.GetReturnValue(Object[] arguments) at Smocks.Setups.Interceptor.InterceptMethod[TReturnValue](Object[] arguments, MethodBase originalMethod) at Smocks.Setups.Interceptor.Intercept[TReturnValue](Object[] arguments, MethodBase originalMethod) at .... ... Smocks.AppDomains.AppDomainContext.InvokeSerializableLambda[T](SerializableLambda1 serializableFunc, Object target, Object[] arguments)
at Smocks.AppDomains.AppDomainContext.Invoke[T](Action1 action, T parameter) at Smocks.Smock.RunAction(Action1 action, Configuration configuration)
at Smocks.Smock.Run(Configuration configuration, Action1 action) at Smocks.Smock.Run(Action1 action)
If I convert it to a List and create one that converts IEnumerable to List it then works. But i have a constraint that i can not alter the code i am testing.
The text was updated successfully, but these errors were encountered:
When executing a Static method that calls ApplyDivisors I get the following exception:
System.InvalidCastException: Object must implement IConvertible.
at System.Convert.ChangeType(Object value, Type conversionType, IFormatProvider provider)
at Smocks.Setups.Setup
1.<>c__DisplayClass2_0
2.b__0(Object[] args)at Smocks.Setups.Setup
1.GetReturnValue(Object[] arguments) at Smocks.Setups.Interceptor.InterceptMethod[TReturnValue](Object[] arguments, MethodBase originalMethod) at Smocks.Setups.Interceptor.Intercept[TReturnValue](Object[] arguments, MethodBase originalMethod) at .... ... Smocks.AppDomains.AppDomainContext.InvokeSerializableLambda[T](SerializableLambda
1 serializableFunc, Object target, Object[] arguments)at Smocks.AppDomains.AppDomainContext.Invoke[T](Action
1 action, T parameter) at Smocks.Smock.RunAction(Action
1 action, Configuration configuration)at Smocks.Smock.Run(Configuration configuration, Action
1 action) at Smocks.Smock.Run(Action
1 action)If I convert it to a List and create one that converts IEnumerable to List it then works. But i have a constraint that i can not alter the code i am testing.
The text was updated successfully, but these errors were encountered: