Open
Description
Case:
List<String> list = Arrays.asList("a", "b", "c");
String[] cd = {"c", "d"};
assertThat("Should not contain each item", list, not(hasItems(cd)));
This assertion won't fail. I understand why it will pass, though it's not expected by most of users.
It would be nice to have simple Matcher to check that "every item is not in the list"
# Now it's possible to use:
assertThat("Should not contain each item", list, everyItem(not(isIn(cd))));
# But that looks much better:
assertThat("Should not contain each item", list, doesNotContainAnyOf(cd));
Metadata
Metadata
Assignees
Labels
No labels