« Return to Thread: First Test - Ignoring addListener()

Re: First Test - Ignoring addListener()

by Greg Akins-3 :: Rate this Message:

Reply to Author | View in Thread

Thanks Steve.

So I started by using some examples based on JMock 1 (http://www.atomicobject.com/pages/Presenter+First 
).  That example used a constraint to capture the listener and execute  
it.

It worked, but I had a brief exchange with Nat on the Yahoo TDD group,  
and he suggested that the test wasn't well written.  That and the fact  
that it was still in JMock 1 led me to rewrite the test.

My class, the JMock 2 based test and the JMock 1 test that I used as a  
starting point are at http://pastie.org/441932

My test might need refactoring.. I want to test that the presenter  
calls the method as instructed by the view listener.   And that the  
correct values is assigned, on the view, as a result of the presenters  
behavior.

On Apr 9, 2009, at 11:57 AM, Steve Freeman wrote:

> context.checking(new Expectations() {{
>  ignoring (viewMock).addListener(with(any(<ListenerType>.class)));
> }};

Greg Akins
Director of Software Development
724.935.8281 x 210 (office)
724.935.8283 (fax)
724.454.7790 (cell)
http://www.towercare.com
gakins@...


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

    http://xircles.codehaus.org/manage_email


 « Return to Thread: First Test - Ignoring addListener()