2
我嘗試下面的代碼,在列表匹配單個ComplexObject多hasProperty約束
assertThat(complexObjectList, Matchers.<ComplexObject>hasItems(
hasProperty("lang", equalTo(lang)),
hasProperty("name", equalTo(name)),
hasProperty("desc", equalTo(desc)));
我希望有
match(lang) && match(name) && match(desc)
一個過濾器,但與上述代碼,我得到
match(lang) || match(name) || match(desc)
如何驗證這三個不同的hasProperty
匹配器?