mirror of
https://github.com/shekhargulati/strman-java.git
synced 2026-10-07 03:53:55 +00:00
Added support for containsAll function
This commit is contained in:
@@ -105,4 +105,27 @@ public class StrmanTest {
|
||||
|
||||
Arrays.stream(fixture).forEach(el -> assertFalse(contains(el, "FOO", true)));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void containsAll_shouldReturnTrueOnlyWhenAllNeedlesAreContainedInValue() throws Exception {
|
||||
String[] fixture = {
|
||||
"foo bar",
|
||||
"bar foo",
|
||||
"foobar",
|
||||
};
|
||||
|
||||
Arrays.stream(fixture).forEach(el -> assertTrue(containsAll(el, new String[]{"FOO", "bar"})));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void containsAll_shouldReturnFalseOnlyWhenAllNeedlesAreNotContainedInValue() throws Exception {
|
||||
String[] fixture = {
|
||||
"foo bar",
|
||||
"bar foo",
|
||||
"foobar",
|
||||
};
|
||||
|
||||
Arrays.stream(fixture).forEach(el -> assertFalse(containsAll(el, new String[]{"FOO", "bar"}, true)));
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user