org.hamcrest.text
Class IsEqualIgnoringCase
java.lang.Object
org.hamcrest.BaseMatcher<T>
org.hamcrest.TypeSafeMatcher<String>
org.hamcrest.text.IsEqualIgnoringCase
- All Implemented Interfaces:
- Matcher<String>, SelfDescribing
public class IsEqualIgnoringCase
- extends TypeSafeMatcher<String>
Tests if a string is equal to another string, regardless of the case.
IsEqualIgnoringCase
public IsEqualIgnoringCase(String string)
matchesSafely
public boolean matchesSafely(String item)
- Specified by:
matchesSafely in class TypeSafeMatcher<String>
describeMismatchSafely
public void describeMismatchSafely(String item,
Description mismatchDescription)
- Overrides:
describeMismatchSafely in class TypeSafeMatcher<String>
describeTo
public void describeTo(Description description)
equalToIgnoringCase
public static Matcher<String> equalToIgnoringCase(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
Copyright © 2014. All rights reserved.