public class StringSubject extends ComparableSubject<StringSubject,String>
Subject.HasField
Modifier and Type | Field | Description |
---|---|---|
static SubjectFactory<StringSubject,String> |
STRING |
Deprecated.
Use a
for each style loop over your Iterable<Integer> instead. |
failureStrategy
Constructor | Description |
---|---|
StringSubject(FailureStrategy failureStrategy,
String string) |
Modifier and Type | Method | Description |
---|---|---|
void |
contains(CharSequence string) |
Fails if the string does not contain the given sequence.
|
void |
containsMatch(String regex) |
Fails if the string does not contain a match on the given regex.
|
void |
containsMatch(Pattern pattern) |
Fails if the string does not contain a match on the given regex.
|
void |
doesNotContain(CharSequence string) |
Fails if the string contains the given sequence.
|
void |
doesNotContainMatch(String regex) |
Fails if the string contains a match on the given regex.
|
void |
doesNotContainMatch(Pattern pattern) |
Fails if the string contains a match on the given regex.
|
void |
doesNotMatch(String regex) |
Fails if the string matches the given regex.
|
void |
doesNotMatch(Pattern regex) |
Fails if the string matches the given regex.
|
void |
endsWith(String string) |
Fails if the string does not end with the given string.
|
protected String |
getDisplaySubject() |
|
void |
hasLength(int expectedLength) |
Fails if the string does not have the given length.
|
void |
is(Object expected) |
|
void |
isEmpty() |
Fails if the string is not equal to the zero-length "empty string."
|
void |
isEqualTo(Object expected) |
Fails if the subject is not equal to the given object.
|
void |
isNotEmpty() |
Fails if the string is equal to the zero-length "empty string."
|
void |
isNull() |
Fails if the string is not null.
|
void |
matches(String regex) |
Fails if the string does not match the given regex.
|
void |
matches(Pattern regex) |
Fails if the string does not match the given regex.
|
void |
startsWith(String string) |
Fails if the string does not start with the given string.
|
comparesEqualTo, isAtLeast, isAtMost, isGreaterThan, isIn, isLessThan, isNotIn
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
check, equals, fail, fail, fail, failWithBadResults, failWithCustomSubject, failWithoutSubject, failWithRawMessage, getSubject, hasField, hashCode, internalCustomName, isA, isInstanceOf, isNotA, isNotEqualTo, isNotInstanceOf, isNotNull, isNotSameAs, isSameAs, labeled, named
@Deprecated public static final SubjectFactory<StringSubject,String> STRING
for each
style loop over your Iterable<Integer>
instead.public StringSubject(FailureStrategy failureStrategy, String string)
protected String getDisplaySubject()
getDisplaySubject
in class Subject<StringSubject,String>
public void is(Object expected)
is
in class Subject<StringSubject,String>
public void isEqualTo(Object expected)
Subject
isEqualTo
in class Subject<StringSubject,String>
public void isNull()
isNull
in class Subject<StringSubject,String>
public void hasLength(int expectedLength)
public void isEmpty()
public void isNotEmpty()
public void contains(CharSequence string)
public void doesNotContain(CharSequence string)
public void startsWith(String string)
public void endsWith(String string)
@GwtIncompatible("java.util.regex.Pattern") public void matches(String regex)
@GwtIncompatible("java.util.regex.Pattern") public void matches(Pattern regex)
@GwtIncompatible("java.util.regex.Pattern") public void doesNotMatch(String regex)
@GwtIncompatible("java.util.regex.Pattern") public void doesNotMatch(Pattern regex)
@GwtIncompatible("java.util.regex.Pattern") public void containsMatch(Pattern pattern)
@GwtIncompatible("java.util.regex.Pattern") public void containsMatch(String regex)
@GwtIncompatible("java.util.regex.Pattern") public void doesNotContainMatch(Pattern pattern)
@GwtIncompatible("java.util.regex.Pattern") public void doesNotContainMatch(String regex)
Copyright © 2019. All rights reserved.