Closed GoogleCodeExporter closed 9 years ago
[deleted comment]
You have my permission to incorporate the source into your code base without
mentioning my name if necessary.
Original comment by sebastia...@gmail.com
on 1 Apr 2013 at 3:15
Attachments:
Original comment by t.denley
on 6 Apr 2013 at 8:08
You can achieve this using the existing matchers by using the map's entry set.
final Map<String, String> map = new HashMap<String, String>();
MatcherAssert.assertThat(map.entrySet(), Matchers.hasSize(3));
Original comment by t.denley
on 6 Apr 2013 at 8:29
Oh, and such a Matcher has already been written for inclusion in the next
release of Hamcrest -- see
https://github.com/hamcrest/JavaHamcrest/blob/master/hamcrest-library/src/main/j
ava/org/hamcrest/collection/IsMapWithSize.java
When this is released, you'll be able to do:
MatcherAssert.assertThat(map, Matchers.aMapWithSize(3));
Original comment by t.denley
on 6 Apr 2013 at 8:39
Original issue reported on code.google.com by
sebastia...@gmail.com
on 1 Apr 2013 at 3:12