Class ShouldContainStringOnlyOnce

java.lang.Object
org.fest.assertions.error.BasicErrorMessageFactory
org.fest.assertions.error.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 Details

    • shouldContainOnlyOnce

      public static ErrorMessageFactory shouldContainOnlyOnce(String actual, 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(String actual, 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.