Package org.assertj.core.internal
Class Char2DArrays
java.lang.Object
org.assertj.core.internal.Char2DArrays
Reusable assertions for two-dimensional arrays of
chars.- Author:
- Maciej Wajcht
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidassertContains(AssertionInfo info, char[][] actual, char[] value, Index index) Verifies that the given array contains the given value at the given index.voidassertDoesNotContain(AssertionInfo info, char[][] actual, char[] value, Index index) Verifies that the given array does not contain the given value at the given index.voidassertEmpty(AssertionInfo info, char[][] actual) Asserts that the given array is empty.voidassertHasDimensions(AssertionInfo info, char[][] actual, int expectedFirstDimension, int expectedSecondDimension) Asserts that the number of elements in the given array is equal to the expected one.voidassertHasSameDimensionsAs(AssertionInfo info, char[][] actual, Object other) Assert that the actual array has the same dimensions as the other array.voidassertNotEmpty(AssertionInfo info, char[][] actual) Asserts that the given array is not empty.voidassertNullOrEmpty(AssertionInfo info, char[][] actual) Asserts that the given array isnullor empty.voidassertNumberOfRows(AssertionInfo info, char[][] actual, int expectedNumberOfRows) Asserts that the number of rows in the given array is equal to the expected one.static Char2DArraysinstance()Returns the singleton instance of this class.void
-
Constructor Details
-
Char2DArrays
public Char2DArrays()
-
-
Method Details
-
instance
Returns the singleton instance of this class.- Returns:
- the singleton instance of this class.
-
setArrays
-
assertNullOrEmpty
Asserts that the given array isnullor empty.- Parameters:
info- contains information about the assertion.actual- the given array.- Throws:
AssertionError- if the given array is notnull*and* contains one or more elements.
-
assertEmpty
Asserts that the given array is empty.- Parameters:
info- contains information about the assertion.actual- the given array.- Throws:
AssertionError- if the given array isnull.AssertionError- if the given array is not empty.
-
assertNotEmpty
Asserts that the given array is not empty.- Parameters:
info- contains information about the assertion.actual- the given array.- Throws:
AssertionError- if the given array isnull.AssertionError- if the given array is empty.
-
assertHasDimensions
public void assertHasDimensions(AssertionInfo info, char[][] actual, int expectedFirstDimension, int expectedSecondDimension) Asserts that the number of elements in the given array is equal to the expected one.- Parameters:
info- contains information about the assertion.actual- the given array.expectedFirstDimension- the expected first dimension size ofactual.expectedSecondDimension- the expected second dimension size ofactual.- Throws:
AssertionError- if the given array isnull.AssertionError- if the actual array's dimensions are not equal to the given ones.
-
assertHasSameDimensionsAs
Assert that the actual array has the same dimensions as the other array.- Parameters:
info- contains information about the assertion.actual- the given array.other- the group to compare- Throws:
AssertionError- if the actual group isnull.AssertionError- if the other group isnull.AssertionError- if the actual group does not have the same dimensions.
-
assertNumberOfRows
Asserts that the number of rows in the given array is equal to the expected one.- Parameters:
info- contains information about the assertion.actual- the given array.expectedNumberOfRows- the expected first dimension size ofactual.
-
assertContains
Verifies that the given array contains the given value at the given index.- Parameters:
info- contains information about the assertion.actual- the given array.value- the value to look for.index- the index where the value should be stored in the given array.- Throws:
AssertionError- if the given array isnullor empty.NullPointerException- if the givenIndexisnull.IndexOutOfBoundsException- if the value of the givenIndexis equal to or greater than the size of the given array.AssertionError- if the given array does not contain the given value at the given index.
-
assertDoesNotContain
Verifies that the given array does not contain the given value at the given index.- Parameters:
info- contains information about the assertion.actual- the given array.value- the value to look for.index- the index where the value should be stored in the given array.- Throws:
AssertionError- if the given array isnull.NullPointerException- if the givenIndexisnull.AssertionError- if the given array contains the given value at the given index.
-