Its important because it supports a whole different style of testing called Context/Specification testing.
If you are doing a Context styled test then from what I've seen you can't actually make use of Mocks. In a Context styled test you have a single method that sets up the action for the entire test fixture. Every test operates under the same context and action. In this case your tests end up actually being single lined asserts for the most part. Mocking assumes that each test contains the actionwhich is not the case. For an example look at http://www.lostechies.com/blogs/colinjack/archive/2008/11/19/context-specification-available-frameworks-bdd.aspx(the NUnit example is easiest to easily read I find). Now you could set up a bunch of mocks in your setup or action but that would break the Assert one thing per test guideline. Without Test Spys doing interaction based testing with context styled testing is very difficult. So having them is very important if you decide to go down this path. On Wed, Dec 10, 2008 at 1:33 AM, korkless <[EMAIL PROTECTED]> wrote: > > On Dec 9, 10:06 pm, "Shane Courtrille" <[EMAIL PROTECTED]> > wrote: > > The terminology is a bit annoying but there are important differences. > > > > Mocks allow you to specify expected behavior BEFORE a call and verify > > that the behavior occurred as expected. > > > > Test Spys allow you to verify behavior AFTER a call without creating > > pre expectations. > > > > why is that an important difference? > the only things that will change using one of the 2 way it's that with > post expectation > - all the tested code will be executed > - the test has an aaa structure > > the logic of the test for me it's exactly the same when using pre or > post expectation. > what i don't understood? > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Rhino.Mocks" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/RhinoMocks?hl=en -~----------~----~----~----~------~----~------~--~---
