Class StringSubject.CaseInsensitiveStringComparison
java.lang.Object
com.google.common.truth.StringSubject.CaseInsensitiveStringComparison
- Enclosing class:
StringSubject
Offers case-insensitive checks for string values.
- Author:
- David Saff, Christian Gruber (cgruber@israfil.net)
-
Method Summary
Modifier and TypeMethodDescriptionvoid
contains
(@Nullable CharSequence string) Checks that the actual value contains the given sequence (while ignoring case).void
doesNotContain
(@Nullable CharSequence string) Checks that the actual value does not contain the given sequence (while ignoring case).void
Checks that the actual value is equal to the given sequence (while ignoring case).void
isNotEqualTo
(@Nullable String other) Checks that the actual value is not equal to the given string (while ignoring case).
-
Method Details
-
isEqualTo
Checks that the actual value is equal to the given sequence (while ignoring case). For the purposes of this comparison, two strings are equal if either of the following is true:- They are equal according to
String.equalsIgnoreCase(java.lang.String)
. (In Kotlin terms: They are equal according toactual.equals(expected, ignoreCase = true)
.) - They are both null.
Example: "abc" is equal to "ABC", but not to "abcd".
- They are equal according to
-
isNotEqualTo
Checks that the actual value is not equal to the given string (while ignoring case). The meaning of equality is the same as for theisEqualTo(java.lang.String)
method. -
contains
Checks that the actual value contains the given sequence (while ignoring case). -
doesNotContain
Checks that the actual value does not contain the given sequence (while ignoring case).
-