aboutsummaryrefslogtreecommitdiff
path: root/src/test/java/fr
diff options
context:
space:
mode:
authorpacien2018-02-02 10:52:30 +0100
committerpacien2018-02-02 10:52:30 +0100
commit48ecf24862fc9d9314e81d877dd3fcc3b7f9c894 (patch)
tree30682e263f379d115e4132614c0a33a5ff18edcc /src/test/java/fr
parent8903ba543f2001d1939dbea58dda1f76907835ec (diff)
downloadwallj-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.java27
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 @@
1package fr.umlv.java.wallj.board;
2
3import org.junit.jupiter.api.Assertions;
4import org.junit.jupiter.api.Test;
5
6import java.util.Arrays;
7import java.util.Collections;
8import java.util.List;
9
10/**
11 * @author Pacien TRAN-GIRARD
12 */
13final 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}