Class StringSubject.CaseInsensitiveStringComparison

  • Enclosing class:
    StringSubject

    public final class StringSubject.CaseInsensitiveStringComparison
    extends java.lang.Object
    Case insensitive propositions for string subjects.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void contains​(@Nullable java.lang.CharSequence expectedSequence)
      Fails if the string does not contain the given sequence (while ignoring case).
      void doesNotContain​(@Nullable java.lang.CharSequence expectedSequence)
      Fails if the string contains the given sequence (while ignoring case).
      void isEqualTo​(@Nullable java.lang.String expected)
      Fails if the subject is not equal to the given sequence (while ignoring case).
      void isNotEqualTo​(@Nullable java.lang.String unexpected)
      Fails if the subject is equal to the given string (while ignoring case).
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • isEqualTo

        public void isEqualTo​(@Nullable java.lang.String expected)
        Fails if the subject is not equal to the given sequence (while ignoring case). For the purposes of this comparison, two strings are equal if any of the following is true:
        • they are equal according to String.equalsIgnoreCase(java.lang.String)
        • they are both null

        Example: "abc" is equal to "ABC", but not to "abcd".

      • isNotEqualTo

        public void isNotEqualTo​(@Nullable java.lang.String unexpected)
        Fails if the subject is equal to the given string (while ignoring case). The meaning of equality is the same as for the isEqualTo(java.lang.String) method.
      • contains

        public void contains​(@Nullable java.lang.CharSequence expectedSequence)
        Fails if the string does not contain the given sequence (while ignoring case).
      • doesNotContain

        public void doesNotContain​(@Nullable java.lang.CharSequence expectedSequence)
        Fails if the string contains the given sequence (while ignoring case).