infinite / mockito-flex

0 stars 0 forks source link

Anonymous Matchers #14

Closed infinite closed 10 years ago

infinite commented 10 years ago

Hi,

Would you consider adding the following convenience function to the MockitoTestCase?

{{{

!actionscript3

public function argThatMatches(matcher:Function): * { return argThat(new FunctionMatcher(matcher)); } }}}

So that we can easily use anonymous functions to verify arguments.

{{{

!actionscript3

verify().that(_listener.validationResultHandler( argThatMatches(function(item:ValidationResultEvent): Boolean { return item.type == ValidationResultEvent.INVALID; }) )); }}}

Thanks, Shanon.

infinite commented 10 years ago

From loomis on 2009-09-30 20:49:23+00:00

I added the code. It will be available in the next release.