diff options
author | pacien | 2018-02-02 10:52:30 +0100 |
---|---|---|
committer | pacien | 2018-02-02 10:52:30 +0100 |
commit | 48ecf24862fc9d9314e81d877dd3fcc3b7f9c894 (patch) | |
tree | 30682e263f379d115e4132614c0a33a5ff18edcc /src/test/java/fr | |
parent | 8903ba543f2001d1939dbea58dda1f76907835ec (diff) | |
download | wallj-48ecf24862fc9d9314e81d877dd3fcc3b7f9c894.tar.gz |
Add matrix shape test
Signed-off-by: pacien <pacien.trangirard@pacien.net>
Diffstat (limited to 'src/test/java/fr')
-rw-r--r-- | src/test/java/fr/umlv/java/wallj/board/MatrixTest.java | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/test/java/fr/umlv/java/wallj/board/MatrixTest.java b/src/test/java/fr/umlv/java/wallj/board/MatrixTest.java new file mode 100644 index 0000000..4510b12 --- /dev/null +++ b/src/test/java/fr/umlv/java/wallj/board/MatrixTest.java | |||
@@ -0,0 +1,27 @@ | |||
1 | package fr.umlv.java.wallj.board; | ||
2 | |||
3 | import org.junit.jupiter.api.Assertions; | ||
4 | import org.junit.jupiter.api.Test; | ||
5 | |||
6 | import java.util.Arrays; | ||
7 | import java.util.Collections; | ||
8 | import java.util.List; | ||
9 | |||
10 | /** | ||
11 | * @author Pacien TRAN-GIRARD | ||
12 | */ | ||
13 | final class MatrixTest { | ||
14 | |||
15 | @Test | ||
16 | void testMatrixSize() { | ||
17 | Integer[][] ma = {{0}, {0}}; | ||
18 | Assertions.assertEquals(Matrix.getWidth(ma), 1); | ||
19 | Assertions.assertEquals(Matrix.getHeight(ma), 2); | ||
20 | |||
21 | List<List<Integer>> ml = Arrays.asList(Collections.singletonList(0), Collections.singletonList(0)); | ||
22 | Assertions.assertEquals(Matrix.getWidth(ml), 1); | ||
23 | Assertions.assertEquals(Matrix.getHeight(ml), 2); | ||
24 | Assertions.assertTrue(Matrix.isShapeValid(ml)); | ||
25 | } | ||
26 | |||
27 | } | ||