public class StringAssert extends GroupAssert<StringAssert,String>
Strings.
To create a new instance of this class invoke .
Assertions.assertThat(String)
actual, myself| Modifier | Constructor and Description |
|---|---|
protected |
StringAssert(String actual)
Creates a new
StringAssert. |
| Modifier and Type | Method and Description |
|---|---|
protected int |
actualGroupSize()
Returns the number of elements in the actual
String. |
StringAssert |
contains(String expected)
Verifies that the actual
String contains the given one. |
StringAssert |
containsIgnoringCase(String text)
Verifies that the actual
String contains the given text regardless of the case. |
StringAssert |
doesNotContain(String text)
Verifies that the actual
String does not contain the given text. |
StringAssert |
doesNotMatch(String regex)
Verifies that the actual
String does not match the given one. |
StringAssert |
endsWith(String expected)
Verifies that the actual
String ends with the given one. |
StringAssert |
excludes(String s)
Verifies that the actual
String does not contains the given one. |
StringAssert |
isEqualToIgnoringCase(String expected)
Verifies that the actual
String is equal to the given one ignoring case. |
StringAssert |
matches(String regex)
Verifies that the actual
String matches the given one. |
StringAssert |
startsWith(String expected)
Verifies that the actual
String starts with the given one. |
hasSize, isEmpty, isNotEmpty, isNullOrEmptyas, as, describedAs, describedAs, doesNotSatisfy, is, isEqualTo, isIn, isIn, isNot, isNotEqualTo, isNotIn, isNotIn, isNotNull, isNotSameAs, isNull, isSameAs, overridingErrorMessage, satisfiescustomErrorMessage, description, description, description, equals, fail, fail, failIfCustomMessageIsSet, failIfCustomMessageIsSet, failure, formattedErrorMessage, hashCode, rawDescription, replaceDefaultErrorMessagesWithprotected StringAssert(String actual)
StringAssert.actual - the target to verify.public StringAssert isEqualToIgnoringCase(String expected)
String is equal to the given one ignoring case.expected - the given String to compare the actual String to.AssertionError - if the actual String is null.AssertionError - if the actual String is not equal to the given one ignoring case.protected int actualGroupSize()
String.actualGroupSize in class GroupAssert<StringAssert,String>String.public StringAssert contains(String expected)
String contains the given one.expected - the given String expected to be contained in the actual one.AssertionError - if the actual String is null.AssertionError - if the actual String does not contain the given one.public StringAssert endsWith(String expected)
String ends with the given one.expected - the given String expected to be at the end of the actual one.AssertionError - if the actual String is null.AssertionError - if the actual String does not end with the given one.public StringAssert startsWith(String expected)
String starts with the given one.expected - the given String expected to be at the beginning of the actual one.AssertionError - if the actual String is null.AssertionError - if the actual String does not start with the given one.public StringAssert excludes(String s)
String does not contains the given one.s - the given String expected not to be contained in the actual one.AssertionError - if the actual String is null.AssertionError - if the actual String does contain the given one.public StringAssert matches(String regex)
String matches the given one.regex - the given regular expression expected to be matched by the actual one.AssertionError - if the actual String is null.AssertionError - if the actual String does not match the given regular expression.public StringAssert doesNotMatch(String regex)
String does not match the given one.regex - the given regular expression expected not to be matched by the actual one.AssertionError - if the actual String is null.AssertionError - if the actual String matches the given regular expression.public StringAssert containsIgnoringCase(String text)
String contains the given text regardless of the case.text - the given text.AssertionError - if the actual String is null.AssertionError - if the actual String does not contain the given text.NullPointerException - if the given String is null.public StringAssert doesNotContain(String text)
String does not contain the given text.text - the given text.AssertionError - if the actual String is null.AssertionError - if the actual String contains the given text.NullPointerException - if the given String is null.Copyright © 2007-2012 FEST (Fixtures for Easy Software Testing). All Rights Reserved.