hamcrest/JavaHamcrest — pull request #3 by sandromancuso (2012-05-22 23:01:07+00:00)
Title: New BeanHas and BeanProperty matchers

The idea is to be able to test multiple properties in a single assertion and get a decent error message when at least one of them does not match.

I've written these matchers and we use them in a few projects at work. We thought that it would be a good idea to contribute back to JavaHamcrest. I changed my original classes to so it would fit better the coding style used in JavaHamcrest, including the way the tests are written.

I know that Hamcrest has the allOf and hasProperty matchers. They are very good but I personally think that BeanHas and BeanProperty could be a good addition to the library since they work in a slightly different way.

For more details, I've blogged about the matchers here: http://craftedsw.blogspot.co.uk/2012/05/testing-multiple-properties-with-single.html