Package org.fest.assertions.error
Class ShouldContainStringOnlyOnce
java.lang.Object
org.fest.assertions.error.BasicErrorMessageFactory
org.fest.assertions.error.ShouldContainStringOnlyOnce
- All Implemented Interfaces:
ErrorMessageFactory
Creates an error message indicating that an assertion that verifies that a
String
contains another String
only
once failed.- Author:
- Pauline Iogna, Joel Costigliola
-
Field Summary
Fields inherited from class org.fest.assertions.error.BasicErrorMessageFactory
arguments, format
-
Method Summary
Modifier and TypeMethodDescriptionstatic ErrorMessageFactory
shouldContainOnlyOnce
(String actual, String sequence, int occurences) Creates a new
.ShouldContainStringOnlyOnce
static ErrorMessageFactory
shouldContainOnlyOnce
(String actual, String sequence, int occurences, ComparisonStrategy comparisonStrategy) Creates a new
.ShouldContainStringOnlyOnce
Methods inherited from class org.fest.assertions.error.BasicErrorMessageFactory
create, equals, hashCode, toString
-
Method Details
-
shouldContainOnlyOnce
public static ErrorMessageFactory shouldContainOnlyOnce(String actual, String sequence, int occurences, ComparisonStrategy comparisonStrategy) Creates a new
.ShouldContainStringOnlyOnce
- Parameters:
actual
- the actual value in the failed assertion.sequence
- the String expected to be inactual
only once.occurences
- the number of occurences of sequence in actual.comparisonStrategy
- theComparisonStrategy
used to evaluate assertion.- Returns:
- the created
ErrorMessageFactory
.
-
shouldContainOnlyOnce
public static ErrorMessageFactory shouldContainOnlyOnce(String actual, String sequence, int occurences) Creates a new
.ShouldContainStringOnlyOnce
- Parameters:
actual
- the actual value in the failed assertion.sequence
- the String expected to be inactual
only once.occurences
- the number of occurences of sequence in actual.- Returns:
- the created
ErrorMessageFactory
.
-