• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to create nested matcher

 
Theodore David Williams
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic