Top Description Fields Constructors Methods
org.assertj.core.internal

public Class Float2DArrays

extends Object
Class Inheritance
Imports
org.assertj.core.api.AssertionInfo, org.assertj.core.data.Index, org.assertj.core.util.VisibleForTesting

Reusable assertions for arrays of floats.
Author
Maciej Wajcht

Field Summary

Modifier and TypeField and Description
private Arrays2D
pack-priv Failures
private static final Float2DArrays

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
assertContains(AssertionInfo
contains information about the assertion.
info
,
float[][]
the given array.
actual
,
float[]
the value to look for.
value
,
Index
the index where the value should be stored in the given array.
index
)

Verifies that the given array contains the given value at the given index.

public void
assertDoesNotContain(AssertionInfo
contains information about the assertion.
info
,
float[][]
the given array.
actual
,
float[]
the value to look for.
value
,
Index
the index where the value should be stored in the given array.
index
)

Verifies that the given array does not contain the given value at the given index.

public void
assertEmpty(AssertionInfo
contains information about the assertion.
info
,
float[][]
the given array.
actual
)

Asserts that the given array is empty.

public void
assertHasDimensions(AssertionInfo
contains information about the assertion.
info
,
float[][]
the given array.
actual
,
int
the expected first dimension size of actual.
expectedFirstDimension
,
int
the expected second dimension size of actual.
expectedSecondDimension
)

Asserts that the number of elements in the given array is equal to the expected one.

public void
assertHasSameDimensionsAs(AssertionInfo
contains information about the assertion.
info
,
float[][]
the given array.
actual
,
Object
the group to compare
other
)

Assert that the actual array has the same dimensions as the other array.

public void
assertNotEmpty(AssertionInfo
contains information about the assertion.
info
,
float[][]
the given array.
actual
)

Asserts that the given array is not empty.

public void
assertNullOrEmpty(AssertionInfo
contains information about the assertion.
info
,
float[][]
the given array.
actual
)

Asserts that the given array is null or empty.

public void
assertNumberOfRows(AssertionInfo
contains information about the assertion.
info
,
float[][]
the given array.
actual
,
int
the expected first dimension size of actual.
expectedNumberOfRows
)

Asserts that the number of rows in the given array is equal to the expected one.

public static Float2DArrays

Returns:

the singleton instance of this class.
instance
()

Returns the singleton instance of this class.

public void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

arraysback to summary
private Arrays2D arrays
failuresback to summary
pack-priv Failures failures
Annotations
@VisibleForTesting
INSTANCEback to summary
private static final Float2DArrays INSTANCE

Constructor Detail

Float2DArraysback to summary
public Float2DArrays()

Method Detail

assertContainsback to summary
public void assertContains(AssertionInfo info, float[][] actual, float[] value, Index index)

Verifies that the given array contains the given value at the given index.

Parameters
info:AssertionInfo

contains information about the assertion.

actual:float[][]

the given array.

value:float[]

the value to look for.

index:Index

the index where the value should be stored in the given array.

Exceptions
AssertionError:
  • if the given array is null or empty.
  • if the given array does not contain the given value at the given index.
NullPointerException:
if the given Index is null.
IndexOutOfBoundsException:
if the value of the given Index is equal to or greater than the size of the given array.
assertDoesNotContainback to summary
public void assertDoesNotContain(AssertionInfo info, float[][] actual, float[] value, Index index)

Verifies that the given array does not contain the given value at the given index.

Parameters
info:AssertionInfo

contains information about the assertion.

actual:float[][]

the given array.

value:float[]

the value to look for.

index:Index

the index where the value should be stored in the given array.

Exceptions
AssertionError:
  • if the given array is null.
  • if the given array contains the given value at the given index.
NullPointerException:
if the given Index is null.
assertEmptyback to summary
public void assertEmpty(AssertionInfo info, float[][] actual)

Asserts that the given array is empty.

Parameters
info:AssertionInfo

contains information about the assertion.

actual:float[][]

the given array.

Exceptions
AssertionError:
  • if the given array is null.
  • if the given array is not empty.
assertHasDimensionsback to summary
public void assertHasDimensions(AssertionInfo info, float[][] actual, int expectedFirstDimension, int expectedSecondDimension)

Asserts that the number of elements in the given array is equal to the expected one.

Parameters
info:AssertionInfo

contains information about the assertion.

actual:float[][]

the given array.

expectedFirstDimension:int

the expected first dimension size of actual.

expectedSecondDimension:int

the expected second dimension size of actual.

Exceptions
AssertionError:
  • if the given array is null.
  • if the actual array's dimensions are not equal to the given ones.
assertHasSameDimensionsAsback to summary
public void assertHasSameDimensionsAs(AssertionInfo info, float[][] actual, Object other)

Assert that the actual array has the same dimensions as the other array.

Parameters
info:AssertionInfo

contains information about the assertion.

actual:float[][]

the given array.

other:Object

the group to compare

Exceptions
AssertionError:
  • if the actual group is null.
  • if the other group is null.
  • if the actual group does not have the same dimension.
assertNotEmptyback to summary
public void assertNotEmpty(AssertionInfo info, float[][] actual)

Asserts that the given array is not empty.

Parameters
info:AssertionInfo

contains information about the assertion.

actual:float[][]

the given array.

Exceptions
AssertionError:
  • if the given array is null.
  • if the given array is empty.
assertNullOrEmptyback to summary
public void assertNullOrEmpty(AssertionInfo info, float[][] actual)

Asserts that the given array is null or empty.

Parameters
info:AssertionInfo

contains information about the assertion.

actual:float[][]

the given array.

Exceptions
AssertionError:
if the given array is not null *and* contains one or more elements.
assertNumberOfRowsback to summary
public void assertNumberOfRows(AssertionInfo info, float[][] actual, int expectedNumberOfRows)

Asserts that the number of rows in the given array is equal to the expected one.

Parameters
info:AssertionInfo

contains information about the assertion.

actual:float[][]

the given array.

expectedNumberOfRows:int

the expected first dimension size of actual.

instanceback to summary
public static Float2DArrays instance()

Returns the singleton instance of this class.

Returns:Float2DArrays

the singleton instance of this class.

setArraysback to summary
public void setArrays(Arrays2D arrays)
Annotations
@VisibleForTesting