Class ShouldContainStringOnlyOnce

  • All Implemented Interfaces:
    ErrorMessageFactory

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

      • shouldContainOnlyOnce

        public static ErrorMessageFactory shouldContainOnlyOnce​(java.lang.String actual,
                                                                java.lang.String sequence,
                                                                int occurences,
                                                                ComparisonStrategy comparisonStrategy)
        Parameters:
        actual - the actual value in the failed assertion.
        sequence - the String expected to be in actual only once.
        occurences - the number of occurences of sequence in actual.
        comparisonStrategy - the ComparisonStrategy used to evaluate assertion.
        Returns:
        the created ErrorMessageFactory.
      • shouldContainOnlyOnce

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