aspose file tools
The moose likes Testing and the fly likes How to create nested matcher Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Engineering » Testing
Reply Bookmark "How to create nested matcher" Watch "How to create nested matcher" New topic
Author

How to create nested matcher

Theodore David Williams
Ranch Hand

Joined: Dec 21, 2009
Posts: 102
I have a matcher that checks a list over a range for a certain value


I am using it as follows:


This works great, however I would really like to be more expressive and write the assert using nested Matchers, i.e.


So I want to pass an inRange matcher to the hasValue matcher. I am really struggling on how do implement this. I am just playing with hamcrest and trying to learn, thanks for any help!
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: How to create nested matcher
 
Similar Threads
StringTokenizer Class
Hamcrest Matcher - changing output in failure case
Problems moving shapes when set up own Shapes class extending Path2D.Double
Fun with stacks
JUnit 4.6 (newbie) not assertion error displayed