Class ShouldHaveSize

All Implemented Interfaces:
ErrorMessageFactory

public class ShouldHaveSize extends BasicErrorMessageFactory
Creates an error message indicating that an assertion that verifies that a value have certain size failed.
Author:
Alex Ruiz
  • Method Details

    • shouldHaveSize

      public static ErrorMessageFactory shouldHaveSize(Object actual, int actualSize, int expectedSize, int firstDimensionArrayIndex)
      Creates a new ShouldHaveSize.
      Parameters:
      actual - the actual value in the failed assertion.
      actualSize - the size of actual.
      expectedSize - the expected size.
      firstDimensionArrayIndex - Index of first dimension of array
      Returns:
      the created ErrorMessageFactory.
    • shouldHaveSize

      public static ErrorMessageFactory shouldHaveSize(Object actual, int actualSize, int expectedSize)
      Creates a new ShouldHaveSize.
      Parameters:
      actual - the actual value in the failed assertion.
      actualSize - the size of actual.
      expectedSize - the expected size.
      Returns:
      the created ErrorMessageFactory.
    • shouldHaveSize

      public static ErrorMessageFactory shouldHaveSize(File actual, long expectedSize)
      Creates a new ShouldHaveSize for file size.
      Parameters:
      actual - the actual file in the failed assertion.
      expectedSize - the expected file size.
      Returns:
      the created ErrorMessageFactory.
    • shouldHaveSize

      public static ErrorMessageFactory shouldHaveSize(Path actual, long expectedSize) throws IOException
      Creates a new ShouldHaveSize for Path file size
      Parameters:
      actual - The actual path file in the failed assertion
      expectedSize - The expected size of the path file
      Returns:
      the created ErrorMessageFactory
      Throws:
      IOException - if an I/O error occurs