Integer range assertion in junit? -


i'd write junit assertion expresses: "integer x must between 10 , 17", can't find easy way of doing this. need implement custom matcher? want error message tells me actual value was.

assertj has isbetween(a, b) matcher built abstractintegerassert. simple test case reads natural language give meaningful failure report "for free":

integer x = 5; assertthat(x).isbetween(10, 17); 

output:

java.lang.assertionerror:  expecting:  <5> between:  [10, 17] 

Comments

Popular posts from this blog

shopping cart - Page redirect not working PHP -

php - How to modify a menu to show sub-menus -

python - Installing PyDev in eclipse is failed -