Exception using InOrder method

2 posts, 0 answers
  1. Daní
    Daní avatar
    303 posts
    Member since:
    Feb 2008

    Posted 06 May 2013 Link to this post

    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();


    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"
  2. Kaloyan
    Kaloyan avatar
    871 posts

    Posted 07 May 2013 Link to this post

    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.

    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.
  3. DevCraft R3 2016 release webinar banner
Back to Top