Class ShouldContainString

  • All Implemented Interfaces:
    ErrorMessageFactory

    public class ShouldContainString
    extends BasicErrorMessageFactory
    Creates an error message indicating that an assertion that verifies that a String contains another String failed.
    Author:
    Alex Ruiz, Joel Costigliola
    • Method Detail

      • shouldContain

        public static ErrorMessageFactory shouldContain​(java.lang.String actual,
                                                        java.lang.String sequence)
        Creates a new ShouldContainString.
        Parameters:
        actual - the actual value in the failed assertion.
        sequence - the sequence of values expected to be in actual.
        Returns:
        the created ErrorMessageFactory.
      • shouldContain

        public static ErrorMessageFactory shouldContain​(java.lang.String actual,
                                                        java.lang.String sequence,
                                                        ComparisonStrategy comparisonStrategy)
        Creates a new ShouldContainString.
        Parameters:
        actual - the actual value in the failed assertion.
        sequence - the sequence of values expected to be in actual.
        comparisonStrategy - the ComparisonStrategy used to evaluate assertion.
        Returns:
        the created ErrorMessageFactory.
      • shouldContainIgnoringCase

        public static ErrorMessageFactory shouldContainIgnoringCase​(java.lang.String actual,
                                                                    java.lang.String sequence)
        Creates a new ShouldContainString.
        Parameters:
        actual - the actual value in the failed assertion.
        sequence - the sequence of values expected to be in actual.
        Returns:
        the created ErrorMessageFactory.