diff options
Diffstat (limited to 'test/ch/epfl')
-rw-r--r-- | test/ch/epfl/xblast/server/BoardTest.java | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/test/ch/epfl/xblast/server/BoardTest.java b/test/ch/epfl/xblast/server/BoardTest.java index e40769b..673ab3b 100644 --- a/test/ch/epfl/xblast/server/BoardTest.java +++ b/test/ch/epfl/xblast/server/BoardTest.java | |||
@@ -14,14 +14,14 @@ import static org.junit.Assert.*; | |||
14 | public class BoardTest { | 14 | public class BoardTest { |
15 | @Test(expected=IllegalArgumentException.class) | 15 | @Test(expected=IllegalArgumentException.class) |
16 | public void isBoardBuilderEmptyInputThrowingException() { | 16 | public void isBoardBuilderEmptyInputThrowingException() { |
17 | List<Sq<Block>> blocks = new ArrayList<Sq<Block>>(); | 17 | List<Sq<Block>> blocks = new ArrayList<>(); |
18 | new Board(blocks); | 18 | new Board(blocks); |
19 | 19 | ||
20 | } | 20 | } |
21 | 21 | ||
22 | @Test(expected=IllegalArgumentException.class) | 22 | @Test(expected=IllegalArgumentException.class) |
23 | public void isBoardBuilderIllegalInputThrowingException() { | 23 | public void isBoardBuilderIllegalInputThrowingException() { |
24 | List<Sq<Block>> blocks = new ArrayList<Sq<Block>>(); | 24 | List<Sq<Block>> blocks = new ArrayList<>(); |
25 | 25 | ||
26 | for (int i = 0;i<8;i++) { | 26 | for (int i = 0;i<8;i++) { |
27 | blocks.add(Sq.constant(Block.FREE)); | 27 | blocks.add(Sq.constant(Block.FREE)); |
@@ -33,14 +33,14 @@ public class BoardTest { | |||
33 | 33 | ||
34 | @Test(expected=IllegalArgumentException.class) | 34 | @Test(expected=IllegalArgumentException.class) |
35 | public void isOfRowsEmptyInputMatrixThrowingException() { | 35 | public void isOfRowsEmptyInputMatrixThrowingException() { |
36 | List<List<Block>> rowsList = new ArrayList<List<Block>>(); | 36 | List<List<Block>> rowsList = new ArrayList<>(); |
37 | Board.ofRows(rowsList); | 37 | Board.ofRows(rowsList); |
38 | } | 38 | } |
39 | 39 | ||
40 | @Test(expected=IllegalArgumentException.class) | 40 | @Test(expected=IllegalArgumentException.class) |
41 | public void isOfRowsIllegalInputThrowingException() { | 41 | public void isOfRowsIllegalInputThrowingException() { |
42 | List<List<Block>> rowsList = new ArrayList<List<Block>>(); | 42 | List<List<Block>> rowsList = new ArrayList<>(); |
43 | List<Block> sampleRow = new ArrayList<Block>(); | 43 | List<Block> sampleRow = new ArrayList<>(); |
44 | 44 | ||
45 | for (int i = 0;i < 8 ;i++) { | 45 | for (int i = 0;i < 8 ;i++) { |
46 | sampleRow.add(Block.FREE); | 46 | sampleRow.add(Block.FREE); |
@@ -52,10 +52,10 @@ public class BoardTest { | |||
52 | 52 | ||
53 | @Test | 53 | @Test |
54 | public void buildBoardFromRowsMatrix() { | 54 | public void buildBoardFromRowsMatrix() { |
55 | List<List<Block>> rowsList = new ArrayList<List<Block>>() ; | 55 | List<List<Block>> rowsList = new ArrayList<>() ; |
56 | 56 | ||
57 | for (int i = 0; i < 13; i++) { | 57 | for (int i = 0; i < 13; i++) { |
58 | List<Block> sampleRow = new ArrayList<Block>(); | 58 | List<Block> sampleRow = new ArrayList<>(); |
59 | for (int j = 0; j < 15; j++) { | 59 | for (int j = 0; j < 15; j++) { |
60 | sampleRow.add(Block.FREE); | 60 | sampleRow.add(Block.FREE); |
61 | } | 61 | } |
@@ -67,14 +67,14 @@ public class BoardTest { | |||
67 | 67 | ||
68 | @Test(expected=IllegalArgumentException.class) | 68 | @Test(expected=IllegalArgumentException.class) |
69 | public void isOfInnerBlocksWalledEmptyInputMatrixThrowingException() { | 69 | public void isOfInnerBlocksWalledEmptyInputMatrixThrowingException() { |
70 | List<List<Block>> rowsList = new ArrayList<List<Block>>(); | 70 | List<List<Block>> rowsList = new ArrayList<>(); |
71 | Board.ofInnerBlocksWalled(rowsList); | 71 | Board.ofInnerBlocksWalled(rowsList); |
72 | } | 72 | } |
73 | 73 | ||
74 | @Test(expected=IllegalArgumentException.class) | 74 | @Test(expected=IllegalArgumentException.class) |
75 | public void isOfInnerBlocksWalledIllegalInputThrowingException() { | 75 | public void isOfInnerBlocksWalledIllegalInputThrowingException() { |
76 | List<List<Block>> rowsList = new ArrayList<List<Block>>(); | 76 | List<List<Block>> rowsList = new ArrayList<>(); |
77 | List<Block> sampleRow = new ArrayList<Block>(); | 77 | List<Block> sampleRow = new ArrayList<>(); |
78 | 78 | ||
79 | for (int i = 0;i < 8 ;i++) { | 79 | for (int i = 0;i < 8 ;i++) { |
80 | sampleRow.add(Block.FREE); | 80 | sampleRow.add(Block.FREE); |
@@ -86,10 +86,10 @@ public class BoardTest { | |||
86 | 86 | ||
87 | @Test | 87 | @Test |
88 | public void buildBoardFromInnerBlocks() { | 88 | public void buildBoardFromInnerBlocks() { |
89 | List<List<Block>> rowsList = new ArrayList<List<Block>>() ; | 89 | List<List<Block>> rowsList = new ArrayList<>() ; |
90 | 90 | ||
91 | for (int i = 0; i < 11; i++) { | 91 | for (int i = 0; i < 11; i++) { |
92 | List<Block> sampleRow = new ArrayList<Block>(); | 92 | List<Block> sampleRow = new ArrayList<>(); |
93 | for (int j = 0; j < 13; j++) { | 93 | for (int j = 0; j < 13; j++) { |
94 | sampleRow.add(Block.FREE); | 94 | sampleRow.add(Block.FREE); |
95 | } | 95 | } |
@@ -101,14 +101,14 @@ public class BoardTest { | |||
101 | 101 | ||
102 | @Test(expected=IllegalArgumentException.class) | 102 | @Test(expected=IllegalArgumentException.class) |
103 | public void isBuildWithEmptyQuadrantThrowingException() { | 103 | public void isBuildWithEmptyQuadrantThrowingException() { |
104 | List<List<Block>> rowsList = new ArrayList<List<Block>>(); | 104 | List<List<Block>> rowsList = new ArrayList<>(); |
105 | Board.ofQuadrantNWBlocksWalled(rowsList); | 105 | Board.ofQuadrantNWBlocksWalled(rowsList); |
106 | } | 106 | } |
107 | 107 | ||
108 | @Test(expected=IllegalArgumentException.class) | 108 | @Test(expected=IllegalArgumentException.class) |
109 | public void isBuildWithIllegalQuadrantThrowingException() { | 109 | public void isBuildWithIllegalQuadrantThrowingException() { |
110 | List<List<Block>> rowsList = new ArrayList<List<Block>>(); | 110 | List<List<Block>> rowsList = new ArrayList<>(); |
111 | List<Block> sampleRow = new ArrayList<Block>(); | 111 | List<Block> sampleRow = new ArrayList<>(); |
112 | 112 | ||
113 | for (int i = 0;i < 8 ;i++) { | 113 | for (int i = 0;i < 8 ;i++) { |
114 | sampleRow.add(Block.FREE); | 114 | sampleRow.add(Block.FREE); |
@@ -120,10 +120,10 @@ public class BoardTest { | |||
120 | 120 | ||
121 | @Test | 121 | @Test |
122 | public void buildBoardFromNWQuadrant() { | 122 | public void buildBoardFromNWQuadrant() { |
123 | List<List<Block>> rowsList = new ArrayList<List<Block>>() ; | 123 | List<List<Block>> rowsList = new ArrayList<>() ; |
124 | 124 | ||
125 | for (int i = 0; i < 6; i++) { | 125 | for (int i = 0; i < 6; i++) { |
126 | List<Block> sampleRow = new ArrayList<Block>(); | 126 | List<Block> sampleRow = new ArrayList<>(); |
127 | for (int j = 0; j < 7; j++) { | 127 | for (int j = 0; j < 7; j++) { |
128 | sampleRow.add(Block.FREE); | 128 | sampleRow.add(Block.FREE); |
129 | } | 129 | } |