Le 3 août 2011 21:40, "Mark Struberg" <[email protected]> a écrit :
>
> Txs Stephen, I just did it that way to not have 10s of different methods.
>
> Anything else I should do different in those tests?
>
> I had troubles to find enough hamcrest machters. E.g. a startsWith exists
in the hamcrest libs, but I could not find them in junit-4.8.2.
What about using fest-assert? I don't know hamcrest very well but I heard
many people saying fest-assert was even more.fluent. I feel the construct is
very natural. It really gives a fluent and simple-to-use api.
Just do a static import of fest-assert assertThat and you're done.
Example from the site:
List<Employee> newEmployees = employees.hired(TODAY);
assertThat(newEmployees).hasSize(6)
.contains(frodo, sam);
assertThat(yoda).isInstanceOf(Jedi.class)
.isEqualTo(foundJedi)
.isNotEqualTo(foundSith);
Cheers
-- Baptiste
Sent from my phone.