Why is my Automock Container instance null?

4 posts, 0 answers
  1. Mark
    Mark avatar
    2 posts
    Member since:
    Mar 2013

    Posted 22 May 2013 Link to this post

    Hi All,
    I hope you can help me with this. I am using a full version of JustMock and am attempting to mock a large class with multiple dependencies. Automocking seemed to be the way to go for this (unit) test. So I referenced the Telerik.JustMock.Container dll in my project, added the proper using statement and wrote the following simple test:

    public void TestAutoMock()
    {
    // Arrange

    var autoMockMFContainer = new MockingContainer<MyCustomClass>();

    autoMockMFContainer.Instance.EstablishMyEmployee(10000, 2, 100007, 2, true, false);
    }

    This seems simple enough but it fails with a NullReferenceException. "Instance" is null. I am new to JustMock so I suspect the problem may lie with the project references or some configuration item but I don't know what it is. 

    Can anyone offer any suggestions as to how I might get the Instance to not be null?

    Thanks
    MM
  2. Kaloyan
    Admin
    Kaloyan avatar
    872 posts

    Posted 23 May 2013 Link to this post

    Hi Mark,

    Thank you for contacting Telerik support.

    It is unfortunate that you are experiencing issues with JustMock. However, everything I read from your message seemed correct and this appears to be a bug in our product. Is it possible to wrap your test method along with your system under test (or you could make us different sample project reproducing the issue) and send it with your next reply for further investigation on our side.

    Having the above, we will be able to find a fix much faster and also suggest a possible workaround for your exact case.

    Thank you for the help in advance.

    Regards,
    Kaloyan
    Telerik
    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
  4. Mark
    Mark avatar
    2 posts
    Member since:
    Mar 2013

    Posted 28 May 2013 Link to this post

     

    Good Morning Kaloyan,

    I am unable to provide you the code for our system however, I whipped up the attached project this morning and it results in the same error. I have submitted a ticket on this issue (698356). I look forward to your reply.

    Thanks,

    MM





  5. Kaloyan
    Admin
    Kaloyan avatar
    872 posts

    Posted 29 May 2013 Link to this post

    Hi Mark,

    I have replied in Forum thread with ID:698356

    I hope this helps.

    Regards,
    Kaloyan
    Telerik
    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.
Back to Top