allow extracting several fields or properties in iterable or array assertions #30

Closed
joel-costigliola opened this Issue Mar 27, 2013 · 5 comments

2 participants

@joel-costigliola

The idea is to be able to extract then check several fields or properties at once, e.g :

assertThat(fellowshipOfTheRing).extracting("race", "name").contains(tuple(HOBBIT, "Frodon"), tuple(HOBBIT, "Frodon"));

Note that extracted values are stored in tuples (Tuple is a simple structure containing objects) so you must use Tuple in the chained assertion.

Assertions provides a handy static method to build tuple, e.g. tuple(HOBBIT, "Frodon")

@xhanin

would be awesome ;-)

@xhanin

Excellent!

@joel-costigliola

by the way, it is available in 1.1.0 which has been released ... yesterday ! (I'm making the official release announcement today)

cheers !

@xhanin
@joel-costigliola

A very welcome spoiler :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment