I'm using hamcrest to describe constraints on stubs in parameterized tests.
When solving these constraints, and describing why solving failed, it's
very useful to be able to generate an example value from a Matcher, and for
many Matchers, it's much easier to do inside the class than from the
outside. Therefore, I've locally created a ValueSet interface, which
inherits from Matcher:
public interface ValueSet<T> extends Matcher<T> {
public T exampleValue();
}
Is, IsEqual, and IsCollectionContaining are relatively easy to extend to
support this, as are many of the numeric Matchers. Is this of general
enough use to be worth including as an option in the base hamcrest
distribution?
Original issue reported on code.google.com by david.s...@gmail.com on 31 Jan 2007 at 7:57
Original issue reported on code.google.com by
david.s...@gmail.com
on 31 Jan 2007 at 7:57