This is a migrated thread and some comments may be shown as answers.

Exception using InOrder method

1 Answer 10 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Daní
Top achievements
Rank 1
Daní asked on 06 May 2013, 03:54 PM
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"

1 Answer, 1 is accepted

Sort by
0
Kaloyan
Telerik team
answered on 07 May 2013, 02:22 PM
Hi Dani,

I tried reproducing such issue with no success.

Could you send us a sample project, reproducing the unexpected behavior. This will help us investigate it further and provide a solution.

Thanks for the cooperation.

Regards,
Kaloyan
the Telerik team
Share what you think about JustTrace & JustMock with us, so we can become even better! You can use the built-in feedback tool inside JustTrace, our forums, or our JustTrace or JustMock portals.
Tags
General Discussions
Asked by
Daní
Top achievements
Rank 1
Answers by
Kaloyan
Telerik team
Share this question
or