看起来很酷
assertThat(yoda).is(jedi);
直到你不知道yoda和jedi是什么。但是假设
yoda
jedi
yoda instanceof Person
其中
interface Person { boolean isJedi(); }
那么实际上如何用AssertJ检查isJedi呢?在传统的JUnit中,我会写
AssertJ
isJedi
JUnit
assertTrue( yoda.isJedi() );
但是在AssertJ中呢?
iugsix8n1#
assertThat(yoda.isJedi()).isTrue()
hkmswyz62#
Assert(尤达.是绝地()).等于(真);
2条答案
按热度按时间iugsix8n1#
hkmswyz62#
Assert(尤达.是绝地()).等于(真);