org.hamcrest.text
Class IsEqualIgnoringCase
java.lang.Object
org.hamcrest.BaseMatcher<T>
org.hamcrest.TypeSafeMatcher<java.lang.String>
org.hamcrest.text.IsEqualIgnoringCase
- All Implemented Interfaces:
- org.hamcrest.Matcher<java.lang.String>, org.hamcrest.SelfDescribing
public class IsEqualIgnoringCase
- extends org.hamcrest.TypeSafeMatcher<java.lang.String>
Tests if a string is equal to another string, regardless of the case.
Method Summary |
void |
describeMismatchSafely(java.lang.String item,
org.hamcrest.Description mismatchDescription)
|
void |
describeTo(org.hamcrest.Description description)
|
static org.hamcrest.Matcher<java.lang.String> |
equalToIgnoringCase(java.lang.String expectedString)
Creates a matcher of String that matches when the examined string is equal to
the specified expectedString, ignoring case. |
boolean |
matchesSafely(java.lang.String item)
|
Methods inherited from class org.hamcrest.TypeSafeMatcher |
describeMismatch, matches |
Methods inherited from class org.hamcrest.BaseMatcher |
_dont_implement_Matcher___instead_extend_BaseMatcher_, toString |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
IsEqualIgnoringCase
public IsEqualIgnoringCase(java.lang.String string)
matchesSafely
public boolean matchesSafely(java.lang.String item)
- Specified by:
matchesSafely
in class org.hamcrest.TypeSafeMatcher<java.lang.String>
describeMismatchSafely
public void describeMismatchSafely(java.lang.String item,
org.hamcrest.Description mismatchDescription)
- Overrides:
describeMismatchSafely
in class org.hamcrest.TypeSafeMatcher<java.lang.String>
describeTo
public void describeTo(org.hamcrest.Description description)
equalToIgnoringCase
public static org.hamcrest.Matcher<java.lang.String> equalToIgnoringCase(java.lang.String expectedString)
- Creates a matcher of
String
that matches when the examined string is equal to
the specified expectedString, ignoring case.
For example:
assertThat("Foo", equalToIgnoringCase("FOO"))
- Parameters:
expectedString
- the expected value of matched strings