Class AssertSameSize
java.lang.Object
org.soliscode.test.assertions.collection.IterableAssertion
org.soliscode.test.assertions.collection.AssertSameSize
A collection of utility methods that support asserting that two collections are the same size.
- Since:
- 1.0.0
- Author:
- evanbergstrom
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
assertSameSize
(Iterable<?> expected, Iterable<?> actual) Assert that the collections are the same size.static void
assertSameSize
(Iterable<?> expected, Iterable<?> actual, String message) Assert that the collections are the same size.static void
assertSameSize
(Iterable<?> expected, Iterable<?> actual, Supplier<String> messageSupplier) Assert that the collections are the same size.Methods inherited from class org.soliscode.test.assertions.collection.IterableAssertion
asIterable, assertIterablesNotNull, assertIterablesNotNull, failIterableIsNull
-
Method Details
-
assertSameSize
Assert that the collections are the same size.- Parameters:
expected
- the collection with the expected sizeactual
- 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
Assert that the collections are the same size.- Parameters:
expected
- the collection with the expected sizeactual
- the collection with the actual sizemessage
- 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 sizeactual
- the collection with the actual sizemessageSupplier
- 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.
-