Added support for containsAll function

This commit is contained in:
Shekhar Gulati
2016-05-04 20:20:01 +05:30
parent 313fb3f989
commit d3c0cac910
3 changed files with 67 additions and 6 deletions
+23
View File
@@ -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)));
}
}