Reputation: 3696
Any Java unit testing framework that supports writing unit testing code like this:
Collection<AType> myCollection = objectUnderTest.doSomething();
assertCollectionContainsAtleast(myCollection, "a Expected value");
Meaning what I would like is some sort of iteration support with some sort of matcher attached.
Upvotes: 0
Views: 154
Reputation: 272357
Take a look at Hamcrest, which contains assertions for many things, including collections. You can use hasItem
, hasKey
, hasValue
etc.
Upvotes: 5