@@ -0,0 +1,1448 @@
+package pylos.test;%0A%0Aimport java.util.LinkedList;%0Aimport java.util.List;%0A%0Aimport pylos.model.Model;%0Aimport pylos.model.Position;%0A%0Apublic class PlaceBallTest extends PylosTestCase %7B%0A%0A%09/**%0A%09 * Test%0A%09 */%0A%09public void testCanPlaceBallAt() %7B%0A%09%09assertTrue(Model.canPlaceBallAt(Position.at(0, 0, 0)));%0A%09%09assertFalse(Model.canPlaceBallAt(Position.at(0, 0, 1))); // plateau vide donc pas de sens placer boule z = 1%0A%0A%09%09List%3CPosition%3E balls = MainTest.gameSample();%0A%09%09for (Position pos : balls) %7B%0A%09%09%09assertFalse(Model.canPlaceBallAt(pos));%0A%09%09%7D%0A%0A%09%09assertFalse(Model.canPlaceBallAt(Position.at(0, 0, 1)));%0A%09%09assertFalse(Model.canPlaceBallAt(Position.at(0, 0, 2)));%0A%09%09assertFalse(Model.canPlaceBallAt(Position.at(0, 0, 3)));%0A%09%09assertTrue(Model.canPlaceBallAt(Position.at(1, 2, 0)));%0A%09%09assertTrue(Model.canPlaceBallAt(Position.at(1, 0, 1)));%0A%09%7D%0A%0A%09public void complexTestCanPlaceBallAt() %7B%0A%09%09List%3CPosition%3E balls = MainTest.complexGameSample();%0A%0A%09%09/**%0A%09%09 * o.oo%0A%09%09 * oooo ...%0A%09%09 * ooo. oo. ..%0A%09%09 * ooo. oo. .. .%0A%09%09 */%0A%0A%09%09for (Position position : balls) %7B%0A%09%09%09assertFalse(Model.canPlaceBallAt(position));%0A%09%09%7D%0A%0A%09%09List%3CPosition%3E accessible = new LinkedList%3CPosition%3E();%0A%09%09accessible.add(Position.at(1, 0, 0));%0A%09%09accessible.add(Position.at(3, 2, 0));%0A%09%09accessible.add(Position.at(3, 3, 0));%0A%09%09accessible.add(Position.at(2, 0, 1));%0A%09%09accessible.add(Position.at(0, 0, 2));%0A%0A%09%09for (Position position : accessible) %7B%0A%09%09%09assertTrue(Model.canPlaceBallAt(position));%0A%09%09%7D%0A%09%7D%0A%7D%0A

Test CanPlaceBallAt() for complex game sample