mlinhard / mockito

Automatically exported from code.google.com/p/mockito
0 stars 0 forks source link

Provide static matcher wrapper method "not" for the "Not" ArgumentMatcher #272

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
When I want to match on the negation of one of the provided matcher methods, I 
shouldn't have to resort to calling the internal Matcher objects as such:

verify(warning).setText((String)argThat(new Not(new Equals("danger"))));

Instead I should be able to do something like:

verify(warning).setText(not(eq("fred")));

I presume this would be more acceptable (if possible) than having to provide 
static negations of each of the matchers:

verify(warning).setText(notEq("fred"));
// "notContains", "notStartsWith", "notSame", etc.

Original issue reported on code.google.com by kandpwel...@gmail.com on 19 Jul 2011 at 6:03

GoogleCodeExporter commented 9 years ago
We already have the not() matcher - it lives in AdditionalMatchers class. 
Cheers :)

Original comment by szcze...@gmail.com on 21 Jul 2011 at 5:46

GoogleCodeExporter commented 9 years ago
Awesome. I didn't even know AdditionalMatchers existed.  This project is great. 
Keep up the good work. 

Original comment by kandpwel...@gmail.com on 21 Jul 2011 at 10:42

GoogleCodeExporter commented 9 years ago

Original comment by brice.du...@gmail.com on 2 Dec 2012 at 10:21