From 8a8f880d336c2564fe015ea48877ba26de78a35a Mon Sep 17 00:00:00 2001 From: dupirefr Date: Sun, 16 Jun 2019 14:40:02 +0200 Subject: [PATCH] [BAEL-2996] Improved test with simpler matrix validation --- .../java/com/baeldung/ejml/SimpleMatrixUnitTest.java | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/libraries-2/src/test/java/com/baeldung/ejml/SimpleMatrixUnitTest.java b/libraries-2/src/test/java/com/baeldung/ejml/SimpleMatrixUnitTest.java index 0f394889c0..7fba7e00a2 100644 --- a/libraries-2/src/test/java/com/baeldung/ejml/SimpleMatrixUnitTest.java +++ b/libraries-2/src/test/java/com/baeldung/ejml/SimpleMatrixUnitTest.java @@ -34,14 +34,6 @@ class SimpleMatrixUnitTest { SimpleMatrix actual = firstMatrix.mult(secondMatrix); - assertThat(actual.numRows()).isEqualTo(expected.numRows()); - assertThat(actual.numCols()).isEqualTo(expected.numCols()); - for (int row = 0; row < actual.numRows(); row++) { - for (int col = 0; col < actual.numCols(); col++) { - assertThat(actual.get(row, col)) - .describedAs("Cells at [%d, %d] don't match", row, col) - .isEqualTo(expected.get(row, col)); - } - } + assertThat(actual).matches(m -> m.isIdentical(expected, 0d)); } }