public class CharSequenceContains extends SubCharSequenceMatcher
mSubstring| Modifier and Type | Method and Description |
|---|---|
static <any> |
containsCharSequence(CharSequence substring)
Creates a matcher that matches if the examined
CharSequence contains the specified
CharSequence anywhere. |
static <any> |
containsString(CharSequence substring)
Alias for
containsCharSequence(CharSequence) for better discoverability. |
protected boolean |
evalSubstringOf(CharSequence s) |
protected CharSequence |
relationship() |
describeMismatchSafely, describeTo, matchesSafelyprotected boolean evalSubstringOf(CharSequence s)
evalSubstringOf in class SubCharSequenceMatcherprotected CharSequence relationship()
relationship in class SubCharSequenceMatcherpublic static <any> containsString(CharSequence substring)
containsCharSequence(CharSequence) for better discoverability.public static <any> containsCharSequence(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