Added support for containsAny function

This commit is contained in:
Shekhar Gulati
2016-05-06 15:40:47 +05:30
parent d3c0cac910
commit b24a5ebbf2
3 changed files with 40 additions and 5 deletions
+19 -1
View File
@@ -124,8 +124,26 @@ public class StrmanTest {
"bar foo",
"foobar",
};
Arrays.stream(fixture).forEach(el -> assertFalse(containsAll(el, new String[]{"FOO", "bar"}, true)));
}
@Test
public void containsAny_shouldReturnTrueWhenAnyOfSearchNeedleExistInInputValue() throws Exception {
String[] fixture = {
"foo bar",
"bar foo",
"foobar",
};
Arrays.stream(fixture).forEach(el -> assertTrue(containsAny(el, new String[]{"foo", "bar", "test"})));
}
@Test
public void containsAny_shouldReturnFalseWhenNoneOfSearchNeedleExistInInputValue() throws Exception {
String[] fixture = {
"foo bar",
"bar foo",
"foobar",
};
Arrays.stream(fixture).forEach(el -> assertFalse(containsAny(el, new String[]{"FOO", "BAR", "Test"}, true)));
}
}