diff --git a/tests/testGeneraux.java b/tests/testGeneraux.java index 04776d7..ce44b18 100644 --- a/tests/testGeneraux.java +++ b/tests/testGeneraux.java @@ -3,14 +3,17 @@ import static org.junit.jupiter.api.Assertions.*; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; +import joueurs.Joueur; import piecesEchiquier.*; class testGeneraux { private Echiquier e; + private Joueur jb; @BeforeEach public void initialisation() { e = new Echiquier(); + jb = new Joueur("Joueur Blanc","Blanc"); } @Test @@ -31,25 +34,33 @@ class testGeneraux { //estVide /*Position p = new Position(3, 6); assertTrue(e.estVide(p));*/ - for (int i = 3; i < 6; i++) { - for (int j = 1; i < 9; i++) { - Position p = new Position(j, i); + for (int x = 1; x < 9; x++) { + for (int y = 3; y < 7; y++) { + Position p = new Position(x, y); assertTrue(e.estVide(p)); } } - for (int i = 0; i < 3; i++) { - for (int j = 1; i < 9; i++) { - Position p = new Position(j, i); + for (int x = 1; x < 9; x++) { + for (int y = 1; y < 3; y++) { + Position p = new Position(x, y); assertFalse(e.estVide(p)); } } - for (int i = 7; i < 9; i++) { - for (int j = 1; i < 9; i++) { - Position p = new Position(j, i); + for (int x = 1; x < 9; x++) { + for (int y = 7; y < 9; y++) { + Position p = new Position(x, y); assertFalse(e.estVide(p)); } } } - + + @Test + public void testePiece () { + //aBouge + e.verificationMouvement(jb, "C2", "c3"); + assertTrue(e.getPionB3().aBouge()); + + assertFalse(e.getCavalierB1().aBouge()); + } } diff --git a/tests/testPiece.java b/tests/testPiece.java index 385deed..bdfa56d 100644 --- a/tests/testPiece.java +++ b/tests/testPiece.java @@ -16,10 +16,6 @@ class testPiece { e = new Echiquier(); jb = new Joueur("Joueur Blanc","Blanc"); jn = new Joueur("Joueur Noir", "Noir"); - - System.out.println(); - System.out.println("nouveau test : "); - System.out.println(); } @AfterEach