If there is a method to mock defined like this:
public virtual void Set<T>() { ... }
And multiple expectations are set like this:
expectations.Methods.Set<string>();
expectations.Methods.Set<Guid>();
A cast exception will occur. This is because the gen'd code only looks at the 0th element in the methodHandlers array. Specifically, since there's no parameters, Rocks "thinks" there could only be one expectation set for it. It doesn't consider the generic parameter values as well. This should also be done if parameters are in play as well.
If there is a method to mock defined like this:
And multiple expectations are set like this:
A cast exception will occur. This is because the gen'd code only looks at the 0th element in the
methodHandlersarray. Specifically, since there's no parameters, Rocks "thinks" there could only be one expectation set for it. It doesn't consider the generic parameter values as well. This should also be done if parameters are in play as well.