peterlck / hamcrest

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

add unordered collection equality matcher #163

Closed GoogleCodeExporter closed 10 years ago

GoogleCodeExporter commented 10 years ago
When testing DAOs and data services, the test I most often perform is 
order-independent collection equality*.

This is because the database (via Hibernate) may return objects in an arbitrary 
order.

I wrote a Matcher that matches collections with the same elements regardless of 
order. It handles duplicate elements as well (the number of occurrences must 
match).

* aka bag-wise equality.

Original issue reported on code.google.com by me%jnova...@gtempaccount.com on 17 Oct 2011 at 1:05