• Post Reply Bookmark Topic Watch Topic
  • New Topic

Flexible JUnit assertions with assertThat()  RSS feed

 
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Stumbled across this post on Joe Walnes' blog. How cool is that?

I love it !

My own implementation (which is not yet self describing, but does work) is:



Works for code like:



P.S.: I'm sorry to say this but I HATE the software of this forum which doesn't let me write ev al!
 
author
Sheriff
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Michael Herrmann:
How cool is that?



Very cool! Thanks for the link!


P.S.: I'm sorry to say this but I HATE the software of this forum which doesn't let me write ev al!



I'm not sure I understand. So you can't write "eval"?
 
Michael Herrmann
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oh. It seems that I can write eval but not eval followed by a parenthesis.
 
Ilja Preuss
author
Sheriff
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ah - I see...
 
Michael Herrmann
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I just generified Constraint (David Saff mentioned generified generics on the junit mailing list). It looks like this (I don't need instanceOf any longer):

 
I think I'll just lie down here for a second. And ponder this tiny ad:
Thread Boost - a very different sort of advertising
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!