Interference between tests

2 posts, 0 answers
  1. Paul
    Paul avatar
    3 posts
    Member since:
    Mar 2008

    Posted 11 Jul 2011 Link to this post


    We are experiencing some problem with some tests where mocking in one test seemed to interfere with another. I.e there is a test class that has 32 tests. When all tests are run one of them fails. When this one test is run on its own it passes. It seems that one of arrangements is not working. It's very difficult to reproduce that in controlled environment and I'm not allowed to send all sources.

    What could cause that and what should I look at. I'm asking for some guidelines that could help me to nail the problem. Alternatively I would appreciate if someone could help me directly with the problem. I'm happy to organise a Live Meeting/Webex/Whatever session to show the problem.

    Thanks in advance.
  2. Ricky
    Ricky avatar
    467 posts

    Posted 15 Jul 2011 Link to this post

    Hi Jimmy,

    Thanks again for sending the issue. However i would recommend you to take a look at the following post:

    The reason behind this issue is that when running as a whole one of the expected member in some test method is already gets invoked and thus during the actual mocking process JM fails to intercept it.

    Please take a look into the post and let me know if you still having the problem once adding the initializer.

    Here please note that you can also include the Mock.Partial or Mock.Initialize in static constructor of the test class as well rather doing it in ClassInitialize

    Kind Regards,
    the Telerik team

    Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

Back to Top