Class ShouldContainCharSequenceOnlyOnce

  • All Implemented Interfaces:
    ErrorMessageFactory

    public class ShouldContainCharSequenceOnlyOnce
    extends BasicErrorMessageFactory
    Creates an error message indicating that an assertion that verifies that a CharSequence contains another CharSequence only once failed.
    Author:
    Pauline Iogna, Joel Costigliola, Mikhail Mazursky
    • Method Detail

      • shouldContainOnlyOnce

        public static ErrorMessageFactory shouldContainOnlyOnce​(CharSequence actual,
                                                                CharSequence sequence,
                                                                int occurrences)
        Parameters:
        actual - the actual value in the failed assertion.
        sequence - the String expected to be in actual only once.
        occurrences - the number of occurrences of sequence in actual.
        Returns:
        the created ErrorMessageFactory.