summaryrefslogtreecommitdiff
path: root/src/ch/epfl/maze/tests
diff options
context:
space:
mode:
Diffstat (limited to 'src/ch/epfl/maze/tests')
-rw-r--r--src/ch/epfl/maze/tests/AnimalTest.java7
-rw-r--r--src/ch/epfl/maze/tests/Competition.java8
-rw-r--r--src/ch/epfl/maze/tests/DaedalusTest.java4
-rw-r--r--src/ch/epfl/maze/tests/GhostsTest.java8
-rw-r--r--src/ch/epfl/maze/tests/MazeTest.java4
-rw-r--r--src/ch/epfl/maze/tests/WorldTest.java16
-rw-r--r--src/ch/epfl/maze/tests/ZooTest.java11
7 files changed, 7 insertions, 51 deletions
diff --git a/src/ch/epfl/maze/tests/AnimalTest.java b/src/ch/epfl/maze/tests/AnimalTest.java
index 4a590ae..123c038 100644
--- a/src/ch/epfl/maze/tests/AnimalTest.java
+++ b/src/ch/epfl/maze/tests/AnimalTest.java
@@ -9,13 +9,11 @@ import org.junit.Test;
9/** 9/**
10 * Test case for {@code Animal} implementation. 10 * Test case for {@code Animal} implementation.
11 */ 11 */
12
13public class AnimalTest extends TestCase { 12public class AnimalTest extends TestCase {
14 13
15 /** 14 /**
16 * Test case for {@code getPosition()}. 15 * Test case for {@code getPosition()}.
17 */ 16 */
18
19 @Test 17 @Test
20 public void testGetPosition() { 18 public void testGetPosition() {
21 Animal animal = new MockAnimal(new Vector2D(2, 1)); 19 Animal animal = new MockAnimal(new Vector2D(2, 1));
@@ -27,7 +25,6 @@ public class AnimalTest extends TestCase {
27 /** 25 /**
28 * Test case for {@code setPosition(Vector2D position)}. 26 * Test case for {@code setPosition(Vector2D position)}.
29 */ 27 */
30
31 @Test 28 @Test
32 public void testSetPosition() { 29 public void testSetPosition() {
33 Animal animal = new MockAnimal(new Vector2D(2, 1)); 30 Animal animal = new MockAnimal(new Vector2D(2, 1));
@@ -40,7 +37,6 @@ public class AnimalTest extends TestCase {
40 /** 37 /**
41 * Test case for {@code update(Direction dir)}. 38 * Test case for {@code update(Direction dir)}.
42 */ 39 */
43
44 @Test 40 @Test
45 public void testUpdate() { 41 public void testUpdate() {
46 Animal animal = new MockAnimal(new Vector2D(2, 1)); 42 Animal animal = new MockAnimal(new Vector2D(2, 1));
@@ -69,7 +65,6 @@ public class AnimalTest extends TestCase {
69 /** 65 /**
70 * Mock class that makes {@code Animal} concrete. 66 * Mock class that makes {@code Animal} concrete.
71 */ 67 */
72
73 private class MockAnimal extends Animal { 68 private class MockAnimal extends Animal {
74 69
75 /** 70 /**
@@ -77,7 +72,6 @@ public class AnimalTest extends TestCase {
77 * 72 *
78 * @param labyrinth Actual maze 73 * @param labyrinth Actual maze
79 */ 74 */
80
81 public MockAnimal(Vector2D position) { 75 public MockAnimal(Vector2D position) {
82 super(position); 76 super(position);
83 } 77 }
@@ -92,4 +86,5 @@ public class AnimalTest extends TestCase {
92 return null; 86 return null;
93 } 87 }
94 } 88 }
89
95} 90}
diff --git a/src/ch/epfl/maze/tests/Competition.java b/src/ch/epfl/maze/tests/Competition.java
index ccbbe73..10a6c84 100644
--- a/src/ch/epfl/maze/tests/Competition.java
+++ b/src/ch/epfl/maze/tests/Competition.java
@@ -31,7 +31,6 @@ import static org.junit.Assert.assertTrue;
31 * against it.</li> 31 * against it.</li>
32 * </ul> 32 * </ul>
33 */ 33 */
34
35public class Competition { 34public class Competition {
36 35
37 static final String COMPETITION_MAZE_FILE = "labyrinth.txt"; 36 static final String COMPETITION_MAZE_FILE = "labyrinth.txt";
@@ -42,7 +41,6 @@ public class Competition {
42 * Launches the competition between the {@code SpaceInvader} and the other 41 * Launches the competition between the {@code SpaceInvader} and the other
43 * animals. 42 * animals.
44 */ 43 */
45
46 @BeforeClass 44 @BeforeClass
47 public static void setUpClass() { 45 public static void setUpClass() {
48 int[][] labyrinth = LabyrinthGenerator.readFromFile(COMPETITION_MAZE_FILE); 46 int[][] labyrinth = LabyrinthGenerator.readFromFile(COMPETITION_MAZE_FILE);
@@ -112,7 +110,6 @@ public class Competition {
112 /** 110 /**
113 * Determines if the {@code SpaceInvader} has beaten the {@code Mouse}. 111 * Determines if the {@code SpaceInvader} has beaten the {@code Mouse}.
114 */ 112 */
115
116 @Test 113 @Test
117 public void testVSMouse() { 114 public void testVSMouse() {
118 assertTrue("The SpaceInvader has not beaten the Mouse", rivalries.get("Mouse") > 0); 115 assertTrue("The SpaceInvader has not beaten the Mouse", rivalries.get("Mouse") > 0);
@@ -121,7 +118,6 @@ public class Competition {
121 /** 118 /**
122 * Determines if the {@code SpaceInvader} has beaten the {@code Hamster}. 119 * Determines if the {@code SpaceInvader} has beaten the {@code Hamster}.
123 */ 120 */
124
125 @Test 121 @Test
126 public void testVSHamster() { 122 public void testVSHamster() {
127 assertTrue("The SpaceInvader has not beaten the Hamster", rivalries.get("Hamster") > 0); 123 assertTrue("The SpaceInvader has not beaten the Hamster", rivalries.get("Hamster") > 0);
@@ -130,7 +126,6 @@ public class Competition {
130 /** 126 /**
131 * Determines if the {@code SpaceInvader} has beaten the {@code Monkey}. 127 * Determines if the {@code SpaceInvader} has beaten the {@code Monkey}.
132 */ 128 */
133
134 @Test 129 @Test
135 public void testVSMonkey() { 130 public void testVSMonkey() {
136 assertTrue("The SpaceInvader has not beaten the Monkey", rivalries.get("Monkey") > 0); 131 assertTrue("The SpaceInvader has not beaten the Monkey", rivalries.get("Monkey") > 0);
@@ -139,7 +134,6 @@ public class Competition {
139 /** 134 /**
140 * Determines if the {@code SpaceInvader} has beaten the {@code Bear}. 135 * Determines if the {@code SpaceInvader} has beaten the {@code Bear}.
141 */ 136 */
142
143 @Test 137 @Test
144 public void testVSBear() { 138 public void testVSBear() {
145 assertTrue("The SpaceInvader has not beaten the Bear", rivalries.get("Bear") > 0); 139 assertTrue("The SpaceInvader has not beaten the Bear", rivalries.get("Bear") > 0);
@@ -148,9 +142,9 @@ public class Competition {
148 /** 142 /**
149 * Determines if the {@code SpaceInvader} has beaten the {@code Panda}. 143 * Determines if the {@code SpaceInvader} has beaten the {@code Panda}.
150 */ 144 */
151
152 @Test 145 @Test
153 public void testVSPanda() { 146 public void testVSPanda() {
154 assertTrue("The SpaceInvader has not beaten the Panda", rivalries.get("Panda") > 0); 147 assertTrue("The SpaceInvader has not beaten the Panda", rivalries.get("Panda") > 0);
155 } 148 }
149
156} 150}
diff --git a/src/ch/epfl/maze/tests/DaedalusTest.java b/src/ch/epfl/maze/tests/DaedalusTest.java
index 070b70d..6087338 100644
--- a/src/ch/epfl/maze/tests/DaedalusTest.java
+++ b/src/ch/epfl/maze/tests/DaedalusTest.java
@@ -13,7 +13,6 @@ import org.junit.Test;
13/** 13/**
14 * Test case for {@code Daedalus} implementation. 14 * Test case for {@code Daedalus} implementation.
15 */ 15 */
16
17public class DaedalusTest extends TestCase { 16public class DaedalusTest extends TestCase {
18 17
19 private final static int[][] LABYRINTH = { 18 private final static int[][] LABYRINTH = {
@@ -25,7 +24,6 @@ public class DaedalusTest extends TestCase {
25 /** 24 /**
26 * Test case for several methods in {@code Daedalus}. 25 * Test case for several methods in {@code Daedalus}.
27 */ 26 */
28
29 @Test 27 @Test
30 public void testGeneral() { 28 public void testGeneral() {
31 Daedalus daedalus = new Daedalus(LABYRINTH); 29 Daedalus daedalus = new Daedalus(LABYRINTH);
@@ -83,7 +81,6 @@ public class DaedalusTest extends TestCase {
83 /** 81 /**
84 * Test case for {@code reset()}. 82 * Test case for {@code reset()}.
85 */ 83 */
86
87 @Test 84 @Test
88 public void testReset() { 85 public void testReset() {
89 Daedalus daedalus = new Daedalus(LABYRINTH); 86 Daedalus daedalus = new Daedalus(LABYRINTH);
@@ -117,4 +114,5 @@ public class DaedalusTest extends TestCase {
117 assertTrue("Animals in Daedalus should be not null", retrievedPred != null); 114 assertTrue("Animals in Daedalus should be not null", retrievedPred != null);
118 assertTrue("Animals in Daedalus should be not null", retrievedPrey != null); 115 assertTrue("Animals in Daedalus should be not null", retrievedPrey != null);
119 } 116 }
117
120} 118}
diff --git a/src/ch/epfl/maze/tests/GhostsTest.java b/src/ch/epfl/maze/tests/GhostsTest.java
index c8c71a9..f4e0c2e 100644
--- a/src/ch/epfl/maze/tests/GhostsTest.java
+++ b/src/ch/epfl/maze/tests/GhostsTest.java
@@ -19,7 +19,6 @@ import org.junit.Test;
19/** 19/**
20 * Test suite for ghosts implementation. 20 * Test suite for ghosts implementation.
21 */ 21 */
22
23public class GhostsTest extends TestCase { 22public class GhostsTest extends TestCase {
24 23
25 public static final boolean DEBUG = false; 24 public static final boolean DEBUG = false;
@@ -29,7 +28,6 @@ public class GhostsTest extends TestCase {
29 * <p> 28 * <p>
30 * In this case, Blinky should go straight to the PacMan's position. 29 * In this case, Blinky should go straight to the PacMan's position.
31 */ 30 */
32
33 @Test 31 @Test
34 public void testBlinky() { 32 public void testBlinky() {
35 int[][] labyrinth = LabyrinthGenerator.getDebugBlinky(); 33 int[][] labyrinth = LabyrinthGenerator.getDebugBlinky();
@@ -50,7 +48,6 @@ public class GhostsTest extends TestCase {
50 * <p> 48 * <p>
51