2 ms·
If all assertions are at the end of the test, then yes. Sometimes this can be made nice with custom matchers, eg: assertThat(fooReturningOptional(), isPresentA
by seadan83 4y ago
If all assertions are at the end of the test, then yes. Sometimes this can be made nice with custom matchers, eg:
assertThat(fooReturningOptional(), isPresentAndIs(4))
Or
assertThat(shape, hasAreaEqualTo(10))
Or
AssertThat(polygonList, hasNoIntersections())
Custom matchers can go off the deep end really easily. One of those cases of learn the principle, then learn when it does not apply