Class ShouldContain

  • All Implemented Interfaces:
    ErrorMessageFactory

    public class ShouldContain
    extends BasicErrorMessageFactory
    Creates an error message indicating that an assertion that verifies a group of elements contains a given set of values failed. A group of elements can be a collection, an array or a String.
    It also mention the ComparisonStrategy used.
    • Constructor Detail

      • ShouldContain

        private ShouldContain​(java.lang.Object actual,
                              java.lang.Object expected,
                              java.lang.Object notFound,
                              ComparisonStrategy comparisonStrategy)
      • ShouldContain

        private ShouldContain​(java.lang.Object actual,
                              java.util.List<java.lang.String> directoryContent,
                              java.lang.String filterDescription)
    • Method Detail

      • shouldContain

        public static ErrorMessageFactory shouldContain​(java.lang.Object actual,
                                                        java.lang.Object expected,
                                                        java.lang.Object notFound,
                                                        ComparisonStrategy comparisonStrategy)
        Creates a new ShouldContain.
        Parameters:
        actual - the actual value in the failed assertion.
        expected - values expected to be in actual.
        notFound - the values in expected not found in actual.
        comparisonStrategy - the ComparisonStrategy used to evaluate assertion.
        Returns:
        the created ErrorMessageFactory.
      • shouldContain

        public static ErrorMessageFactory shouldContain​(java.lang.Object actual,
                                                        java.lang.Object expected,
                                                        java.lang.Object notFound)
        Creates a new ShouldContain.
        Parameters:
        actual - the actual value in the failed assertion.
        expected - values expected to be in actual.
        notFound - the values in expected not found in actual.
        Returns:
        the created ErrorMessageFactory.
      • directoryShouldContain

        public static ErrorMessageFactory directoryShouldContain​(java.io.File actual,
                                                                 java.util.List<java.lang.String> directoryContent,
                                                                 java.lang.String filterDescription)
      • directoryShouldContain

        public static ErrorMessageFactory directoryShouldContain​(java.nio.file.Path actual,
                                                                 java.util.List<java.lang.String> directoryContent,
                                                                 java.lang.String filterDescription)