chevron-thin-right chevron-thin-left brand cancel-circle search youtube-icon google-plus-icon linkedin-icon facebook-icon twitter-icon toolbox download check linkedin phone twitter-old google-plus facebook profile-male chat calendar profile-male
0 votes
Running Visual Studio 2010 with MSTest and TypeMock Isolator 6.0.2.

I have a test class with a bunch of test methods, some of these test methods use mocking while others don't. If I run the tests that do not use TypeMock while having the [ClearMocks] attribute at the test class, there is still a significant overhead to the unit tests. The overhead is in the order of 6-10 seoncds per test method, but it seems to correlate with the amount of code that is run from the unit test. This overhead disappear if I remove the [ClearMocks] attribute. I have not been able to determine what triggers this overhead, I can only see that neither the test methods, the TestInitialize nor the TestCleanup methods use TypeMock.

Furthermore, If I replace this [ClearMocks] attribute with MockManager.ClearAll() in the TestCleanup method, then the overhead also practically dissappears.

Finally, the overhead is only there when I run the tests through Visual Studio. If I run them from the command line with TMockRunner MSTest (...) then the overhead is gone.

Is this a known issue with running tests from within Visual Studio or am I doing something wrong?
asked by Mads (720 points)

6 Answers

0 votes
Hi,

We don't know about a specific problem with ClearMocks. I would like to investigate it. Will you be able to send us a project that reproduces it?

Regards,
Elisha,
Typemock Support
answered by Elisha (12k points)
0 votes
I'm not really sure what triggers the problem. I can see it in some of the unit tests that end up invoking the most code, but haven't been able to reproduce it in a simple project.

I'll try to create a reproducible example.
answered by Mads (720 points)
0 votes
I've created a solution that displays the problem. How can I send it to you?
answered by Mads (720 points)
0 votes
Mads,

Please email us at support@typemock.com.

Thanks,
Doron
Typemock Support
answered by doron (17.2k points)
0 votes
I sent a VS2010 solution yesterday. Hope you received it.
answered by Mads (720 points)
0 votes
Hi Mads,

We have received your repro, thanks!

I'll be in touch with you via our support system.
answered by igal (5.7k points)
...