I am trying to test that Caliburn.Micro method, PublishOnUIThread()
is called:
public static class EventAggregatorExtensions
{
...
public static void PublishOnUIThread(this IEventAggregator eventAggregator, object message);
...
}
I am trying to test like this:
//assert
_eventAggregator.AssertWasCalled(x =>
x.PublishOnUIThread(Arg<object>
.Is.Anything));
but get the error:
System.InvalidOperationException : When using
Arg<T>
, all arguments must be defined usingArg<T>.Is, Arg<T>.Text, Arg<T>.List, Arg<T>.Ref or Arg<T>.Out
. 2 arguments expected, 1 have been defined.
However, I cannot force the method to take 2 parameters. I'm new to testing so I'm not sure how to work around this.