Package org.assertj.core.internal
Class Short2DArrays
- java.lang.Object
-
- org.assertj.core.internal.Short2DArrays
-
public class Short2DArrays extends Object
Reusable assertions for two-dimensional arrays ofshort
s.- Author:
- Maciej Wajcht
-
-
Constructor Summary
Constructors Constructor Description Short2DArrays()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
assertContains(AssertionInfo info, short[][] actual, short[] value, Index index)
Verifies that the given array contains the given value at the given index.void
assertDoesNotContain(AssertionInfo info, short[][] actual, short[] value, Index index)
Verifies that the given array does not contain the given value at the given index.void
assertEmpty(AssertionInfo info, short[][] actual)
Asserts that the given array is empty.void
assertHasDimensions(AssertionInfo info, short[][] actual, int expectedFirstDimensionSize, int expectedSecondDimensionSize)
Asserts that the number of elements in the given array is equal to the expected one.void
assertHasSameDimensionsAs(AssertionInfo info, short[][] actual, Object other)
Assert that the actual array has the same dimensions as the other array.void
assertNotEmpty(AssertionInfo info, short[][] actual)
Asserts that the given array is not empty.void
assertNullOrEmpty(AssertionInfo info, short[][] actual)
Asserts that the given array isnull
or empty.static Short2DArrays
instance()
Returns the singleton instance of this class.void
setArrays(Arrays2D arrays)
-
-
-
Field Detail
-
INSTANCE
private static final Short2DArrays INSTANCE
-
arrays
private Arrays2D arrays
-
failures
Failures failures
-
-
Method Detail
-
instance
public static Short2DArrays instance()
Returns the singleton instance of this class.- Returns:
- the singleton instance of this class.
-
setArrays
public void setArrays(Arrays2D arrays)
-
assertNullOrEmpty
public void assertNullOrEmpty(AssertionInfo info, short[][] actual)
Asserts that the given array isnull
or 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
public void assertEmpty(AssertionInfo info, short[][] actual)
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
public void assertNotEmpty(AssertionInfo info, short[][] actual)
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, short[][] actual, int expectedFirstDimensionSize, int expectedSecondDimensionSize)
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.expectedFirstDimensionSize
- the expected first dimension size ofactual
.expectedSecondDimensionSize
- 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
public void assertHasSameDimensionsAs(AssertionInfo info, short[][] actual, Object other)
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 dimension.
-
assertContains
public void assertContains(AssertionInfo info, short[][] actual, short[] value, Index index)
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 isnull
or empty.NullPointerException
- if the givenIndex
isnull
.IndexOutOfBoundsException
- if the value of the givenIndex
is 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
public void assertDoesNotContain(AssertionInfo info, short[][] actual, short[] value, Index index)
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 givenIndex
isnull
.AssertionError
- if the given array contains the given value at the given index.
-
-