类 StringContains
- java.lang.Object
- org.hamcrest.BaseMatcher<T>
- org.hamcrest.TypeSafeMatcher<String>
- org.hamcrest.core.SubstringMatcher
- org.hamcrest.core.StringContains
- 所有已实现的接口:
Matcher<String>
,SelfDescribing
public class StringContains extends SubstringMatcher
Tests if the argument is a string that contains a substring.
字段概要
从类继承的字段 org.hamcrest.core.SubstringMatcher
substring
构造器概要
构造器 构造器 说明 StringContains(String substring)
方法概要
所有方法 静态方法 实例方法 具体方法 修饰符和类型 方法 说明 static Matcher<String>
containsString(String substring)
protected boolean
evalSubstringOf(String s)
protected String
relationship()
从类继承的方法 org.hamcrest.core.SubstringMatcher
describeMismatchSafely, describeTo, matchesSafely
从类继承的方法 org.hamcrest.TypeSafeMatcher
describeMismatch, matches
从类继承的方法 org.hamcrest.BaseMatcher
_dont_implement_Matcher___instead_extend_BaseMatcher_, toString
构造器详细资料
StringContains
public StringContains(String substring)
方法详细资料
evalSubstringOf
protected boolean evalSubstringOf(String s)
- 指定者:
evalSubstringOf
在类中SubstringMatcher
relationship
protected String relationship()
- 指定者:
relationship
在类中SubstringMatcher
containsString
public static Matcher<String> containsString(String substring)
Creates a matcher that matches if the examinedString
contains the specifiedString
anywhere. For example:assertThat("myStringOfNote", containsString("ring"))
- 参数:
substring
- the substring that the returned matcher will expect to find within any examined string