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

Interference between tests

1 Answer 54 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Paul
Top achievements
Rank 1
Paul asked on 11 Jul 2011, 11:53 AM
Hi

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.

1 Answer, 1 is accepted

Sort by
0
Ricky
Telerik team
answered on 15 Jul 2011, 12:25 PM
Hi Jimmy,

Thanks again for sending the issue. However i would recommend you to take a look at the following post:
http://www.telerik.com/community/forums/justmock/general-discussions/mocks-failing-to-work-correctly-in-large-test-runs.aspx

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,
Mehfuz
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!

Tags
General Discussions
Asked by
Paul
Top achievements
Rank 1
Answers by
Ricky
Telerik team
Share this question
or