Class Abstract2DArrayAssert<SELF extends Abstract2DArrayAssert<SELF,ACTUAL,ELEMENT>,ACTUAL,ELEMENT>

java.lang.Object
org.assertj.core.api.AbstractAssert<SELF,ACTUAL>
org.assertj.core.api.Abstract2DArrayAssert<SELF,ACTUAL,ELEMENT>
Type Parameters:
SELF - the "self" type of this assertion class.
ACTUAL - the type of the "actual" value which is a two-dimensional Array of ELEMENT.
ELEMENT - the type of the "actual" array element.
All Implemented Interfaces:
Array2DAssert<SELF,ELEMENT>, Assert<SELF,ACTUAL>, Descriptable<SELF>, ExtensionPoints<SELF,ACTUAL>
Direct Known Subclasses:
Boolean2DArrayAssert, Byte2DArrayAssert, Char2DArrayAssert, Double2DArrayAssert, Float2DArrayAssert, Int2DArrayAssert, Long2DArrayAssert, Object2DArrayAssert, Short2DArrayAssert

public abstract class Abstract2DArrayAssert<SELF extends Abstract2DArrayAssert<SELF,ACTUAL,ELEMENT>,ACTUAL,ELEMENT> extends AbstractAssert<SELF,ACTUAL> implements Array2DAssert<SELF,ELEMENT>
Base class for all two-dimensional array assertions.
Since:
3.17.0
Author:
Maciej Wajcht
  • Constructor Details

    • Abstract2DArrayAssert

      protected Abstract2DArrayAssert(ACTUAL actual, Class<?> selfType)
  • Method Details

    • isDeepEqualTo

      public abstract SELF isDeepEqualTo(ACTUAL expected)
      Verifies that the actual 2D array is deeply equal to the given one.

      Two arrays are considered deeply equal if both are null or if they refer to arrays that contain the same number of elements and all corresponding pairs of elements in the two arrays are deeply equal.

      Example:

       // assertion will pass
       assertThat(new int[][] {{1, 2}, {3, 4}}).isDeepEqualTo(new int[][] {{1, 2}, {3, 4}});
      
       // assertions will fail
       assertThat(new int[][] {{1, 2}, {3, 4}}).isDeepEqualTo(new int[][] {{1, 2}, {9, 10}});
       assertThat(new int[][] {{1, 2}, {3, 4}}).isDeepEqualTo(new int[][] {{1, 2, 3}, {4}});
      Parameters:
      expected - the given value to compare the actual value to.
      Returns:
      this assertion object.
      Throws:
      AssertionError - if the actual 2D array is not deeply equal to the given one.