We are not able to mock this class in RhinoMocks.
public class Service
{
public Service(Command[] commands){}
}
public abstract class Command {}
// Code
var mock = MockRepository.GenerateMock<Service>(new Command[]{}); // or
mock = MockRepository.GenerateMock<Service>(null)
Rhino mocks fails complaining that it cannot find a constructor with matching arguments. What am I doing wrong?
Thanks,
Try like this:
var mock = MockRepository.GenerateMock<Service>(
new object[] { new Command[0] }
);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With