public class CharSequenceContains extends SubCharSequenceMatcher
mSubstring
Modifier and Type | Method and Description |
---|---|
static <any> |
containsCharSequence(java.lang.CharSequence substring)
Creates a matcher that matches if the examined
CharSequence contains the specified
CharSequence anywhere. |
static <any> |
containsString(java.lang.CharSequence substring)
Alias for
containsCharSequence(CharSequence) for better discoverability. |
protected boolean |
evalSubstringOf(java.lang.CharSequence s) |
protected java.lang.CharSequence |
relationship() |
describeMismatchSafely, describeTo, matchesSafely
protected boolean evalSubstringOf(java.lang.CharSequence s)
evalSubstringOf
in class SubCharSequenceMatcher
protected java.lang.CharSequence relationship()
relationship
in class SubCharSequenceMatcher
public static <any> containsString(java.lang.CharSequence substring)
containsCharSequence(CharSequence)
for better discoverability.public static <any> containsCharSequence(java.lang.CharSequence substring)
CharSequence
contains the specified
CharSequence
anywhere.
For example:
assertThat("myStringOfNote", containsCharSequence("ring"))
substring
- the substring that the returned matcher will expect to find within any
examined string