我正在测试,我有一个随机顺序的字符串错误消息列表,我想使用方法 containsInAnyOrder ,但是使用动态消息号表示我将其作为例如:
assertThat (errors, containsInAnyOrder (
hasProperty ("message", is (messagesError.get (0))),
hasProperty ("message", is (messagesError.get (1)))
));
我想使其更通用:
assertThat (errors, containsInAnyOrder (
hasProperty ("message", is (messagesError.get (i)))
));
感谢