General Question on using mocks related to failing tests.

0 views
Skip to first unread message

John Morales

unread,
Mar 15, 2007, 12:34:07 AM3/15/07
to Rhino...@googlegroups.com
Hi Ayende,

Attached is a sample project if you need to understand what i'm referring to. The problem we are seeing using Rhino Mocks is that we call verifyall on all our tests, what we are noticing is that if one test fails, all tests that run after it fails if they use the same mock even though running individually they pass. What we normally do is create all the mocks in the testfixturesetup because creating the mocks adhoc in every test is dramatically slower.  Is this the correct way of using RM?

If you look at the attached project running the testfixture entirely both tests fail. If you run the second test in the class though it passes, even though the test is independent of the first one. Note if we remove the verifyall from the teardown it works as desired. Should we not use VerifyAll? or is this fixed in 3.0?

Any help would be appreciated. If it is a bug and you would like me to look into it I can.


--
John Morales
http://shortersigs.com/5008XVFPDHMK
RhinoSample.rar

Ayende Rahien

unread,
Mar 15, 2007, 2:39:44 AM3/15/07
to Rhino...@googlegroups.com
What version of rhino mocks are you using?
You definitely should not get a slow down because of Rhino Mocks.
How much mock setup do you have?

John Morales

unread,
Mar 15, 2007, 11:36:29 AM3/15/07
to Rhino...@googlegroups.com
2.6.0.43183

Don't get me wrong the tests are still fast when creating the mocks in every test. Its just super fast relatively if you create the mock in the testfixture setup and just call BackToRecord in setup.

Is this approach supported?

Ayende Rahien

unread,
Mar 15, 2007, 11:45:04 AM3/15/07
to Rhino...@googlegroups.com
In version 2.6.6 I made a major performance improvement that would make this optimization a no-op, basically.
I suggest that you would upgrade to version 2.9.6 at the moment.

John Morales

unread,
Mar 15, 2007, 3:02:32 PM3/15/07
to Rhino...@googlegroups.com
Ok will do. Thanks
Reply all
Reply to author
Forward
0 new messages