Hi JustMock team,
I'm trying to test that methods are being called in the correct order. I have the following code in one of my tests:
var busyMonitor = Mock.Create<IBusyMonitor>();
target.BusyMonitor = busyMonitor;
Mock.Arrange(() => busyMonitor.RegisterActivity(Arg.IsAny<BusyActivity>())).InOrder();
Mock.Arrange(() => busyMonitor.UnregisterActivity(Arg.IsAny<BusyActivity>())).InOrder();
target.DoSomethiing();
Mock.Assert(busyMonitor);
Calling target.DoSomething involves calling BusyMonitor.RegisterActivity and BusyMonitot.UnregisterActivity methods. However I'm getting an exception when target objject insance calls BusyMonitor.UnregisterActivity.
The excepcion thrown is an ArgumentNullException with message:"Value cannot be null. Parameter name: source"
I'm trying to test that methods are being called in the correct order. I have the following code in one of my tests:
var busyMonitor = Mock.Create<IBusyMonitor>();
target.BusyMonitor = busyMonitor;
Mock.Arrange(() => busyMonitor.RegisterActivity(Arg.IsAny<BusyActivity>())).InOrder();
Mock.Arrange(() => busyMonitor.UnregisterActivity(Arg.IsAny<BusyActivity>())).InOrder();
target.DoSomethiing();
Mock.Assert(busyMonitor);
Calling target.DoSomething involves calling BusyMonitor.RegisterActivity and BusyMonitot.UnregisterActivity methods. However I'm getting an exception when target objject insance calls BusyMonitor.UnregisterActivity.
The excepcion thrown is an ArgumentNullException with message:"Value cannot be null. Parameter name: source"