Update from someone who had a related issue
I also had the issue that I couldn't really get the parameters right when raising an event, in my case with one (relevant) parameter.
This is the event that I want to reach within my production code.
private void ProcessDataSet(object sender, IMeasurementDataSet e)
{
...
}
I finally found two equivalent syntax for achieving this (it seems like the two separate parameters this
and measurementDataSet.Object
are converted into a object[]
anyway):
_dataRecorder.Raise(mock => mock.DataSetAvailable += null, new object[] {this, measurementDataSet.Object });
_dataRecorder.Raise(mock => mock.DataSetAvailable += null, this, measurementDataSet.Object);
Once more I will also reference Moq's excellent Quickstart Guide - it really helps!