Hi,
We have repositories which have a "Save" method. They also throw a "Created" event whenever an entity is saved.
We have been trying to use Moq to mock out the repository as such....
var IRepository = new Mock<IRepository>();
Request request = new Request();
IRepository.Setup(a => a.Save(request)).Raises(a => a.Created += null, RequestCreatedEventArgs.Empty);
This doesn't seem to work and I always get an exception:
System.Reflection.TargetParameterCountException: Parameter count mismatch.
Any example of mocking events with Moq would be helpful.