aboutsummaryrefslogtreecommitdiff
path: root/test/ch/epfl
diff options
context:
space:
mode:
Diffstat (limited to 'test/ch/epfl')
-rw-r--r--test/ch/epfl/xblast/server/BoardTest.java19
1 files changed, 19 insertions, 0 deletions
diff --git a/test/ch/epfl/xblast/server/BoardTest.java b/test/ch/epfl/xblast/server/BoardTest.java
index 673ab3b..b23ac06 100644
--- a/test/ch/epfl/xblast/server/BoardTest.java
+++ b/test/ch/epfl/xblast/server/BoardTest.java
@@ -4,6 +4,7 @@ import java.util.List;
4import java.util.ArrayList; 4import java.util.ArrayList;
5import org.junit.Test; 5import org.junit.Test;
6import ch.epfl.cs108.Sq; 6import ch.epfl.cs108.Sq;
7import ch.epfl.xblast.Cell;
7 8
8import static org.junit.Assert.*; 9import static org.junit.Assert.*;
9 10
@@ -132,4 +133,22 @@ public class BoardTest {
132 133
133 assertTrue(Board.ofQuadrantNWBlocksWalled(rowsList) instanceof Board); 134 assertTrue(Board.ofQuadrantNWBlocksWalled(rowsList) instanceof Board);
134 } 135 }
136
137 @Test
138 public void isBlockAtReturningTheRightBlock() {
139 Cell sampleCell = new Cell(0,0);
140 Cell sampleCell2 = new Cell(3,4);
141
142 List<Sq<Block>> blocksList = new ArrayList<>();
143
144 blocksList.add(Sq.constant(Block.INDESTRUCTIBLE_WALL));
145 for (int i = 0; i < 194; i++) {
146 blocksList.add(Sq.constant(Block.FREE));
147 }
148 Board sampleBoard = new Board(blocksList);
149
150 assertTrue(sampleBoard.blockAt(sampleCell) == Block.INDESTRUCTIBLE_WALL);
151 assertTrue(sampleBoard.blockAt(sampleCell2) == Block.FREE);
152 }
153
135} 154}