incubator-flex-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Heidegger ...@leichtgewicht.at>
Subject Re: [RT] Recommendation Unit-Test System?
Date Thu, 09 Feb 2012 17:58:03 GMT
On 10/02/2012 02:45, Omar Gonzalez wrote:
> I'd definitely used FlexUnit 4. I'm not sure about Mockito though, I've
> only used Mockolate. I wonder how they compare. The biggest issue I've seen
> people have is this:
>
> stub(myObj).method("aMagicStringMethodName").returns(someOtherObj);
>
> Some people have issue w/ the magic strings, does Mockito have a different
> approach?
>
> -omar
>

The mockito approach is like

    given( myObj.aMethodCall(possibleArg) ).willReturn(someOtherObj);

I do like the approach. My problem with Mockito is that the verification:

    verify().that( myObj.aMethodCall() );

checks if there was _any_ execution of this method call. Optionally there is

    inOrder().verify().that( ... );

the way I prefer to do the unit tests.

yours
Martin.



Mime
View raw message