Hi,

well, if you really want to use BDD to construct unit tests you really should consider to use mockito instead jmock (http://code.google.com/p/mockito/). Its nativelly bdd like...

and you could use it with Jbehave too..

cheers.

Cristiano

[email protected] escreveu:
Brian,

Thanks but that will remove the ability to reuse the @Given method. I
would expect to have a set of Objects given many times but working on
different operations. By setting mock expectations in a Given then they
will be expected to be called every time.

I would need to say something like

Given a service object and a DAO object
Then expect the DAO methodA to be invoked by service
When the service object is invoked

Without having tried can you even swap about the logic like that?
Lexically it says the same to me?

Chris

Chris,

I would suggest doing the following:

In the @Given method, create the service, DAO, injection, expects and
replay
In the @Then method, call the method
In the @When method, verify

You could then have a @AfterScenario that resets the mocks

Let me know if that doesn't make sense - or I may have EasyMock and JMock
confused.


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email


Reply via email to