aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/ch/epfl/xblast/Direction.java2
-rw-r--r--test/ch/epfl/xblast/server/BoardTest.java19
2 files changed, 20 insertions, 1 deletions
diff --git a/src/ch/epfl/xblast/Direction.java b/src/ch/epfl/xblast/Direction.java
index 700f9be..030038b 100644
--- a/src/ch/epfl/xblast/Direction.java
+++ b/src/ch/epfl/xblast/Direction.java
@@ -2,7 +2,7 @@ package ch.epfl.xblast;
2 2
3/** 3/**
4 * A Direction. 4 * A Direction.
5 * 5 *
6 * @author Pacien TRAN-GIRARD (261948) 6 * @author Pacien TRAN-GIRARD (261948)
7 * @author Timothée FLOURE (257420) 7 * @author Timothée FLOURE (257420)
8 */ 8 */
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}