开发者

Using not operation in hamcrest

I was recently trying to assert the inequality in one of 开发者_高级运维the test. However I wasnt able to find the appropriate matcher in hamcrest. What I ideally want to do is something like.

assertThat(2 , isNot(3));

Is there any way to do it?


You're almost there:

assertThat(2 , is(not(3)));


Be sure you import it:

import static org.hamcrest.CoreMatchers.not;
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜