Class AssertSameSize

java.lang.Object
org.soliscode.test.assertions.collection.IterableAssertion
org.soliscode.test.assertions.collection.AssertSameSize

public final class AssertSameSize extends IterableAssertion
A collection of utility methods that support asserting that two collections are the same size.
Since:
1.0.0
Author:
evanbergstrom
  • Method Details

    • assertSameSize

      public static void assertSameSize(Iterable<?> expected, Iterable<?> actual)
      Assert that the collections are the same size.
      Parameters:
      expected - the collection with the expected size
      actual - the collection with the actual size
      Throws:
      org.opentest4j.AssertionFailedError - if the collection is not empty.
      NullPointerException - is either of the collections are null.
    • assertSameSize

      public static void assertSameSize(Iterable<?> expected, Iterable<?> actual, String message)
      Assert that the collections are the same size.
      Parameters:
      expected - the collection with the expected size
      actual - the collection with the actual size
      message - The message to supply if the assertion fails.
      Throws:
      org.opentest4j.AssertionFailedError - if the collection is not empty.
      NullPointerException - is either of the collections are null.
    • assertSameSize

      public static void assertSameSize(Iterable<?> expected, Iterable<?> actual, Supplier<String> messageSupplier)
      Assert that the collections are the same size.
      Parameters:
      expected - the collection with the expected size
      actual - the collection with the actual size
      messageSupplier - The supplier to call top generate message to supply if the assertion fails.
      Throws:
      org.opentest4j.AssertionFailedError - if the collection is not empty.
      NullPointerException - is either of the collections are null.