tout ca tout ca
This commit is contained in:
@@ -39,6 +39,16 @@ class ChessboardTest {
|
||||
this.chessboard.placeQueen(1, 2);
|
||||
this.chessboard.placeQueen(2, 4);
|
||||
assertEquals(3, this.chessboard.getNumberOfQueen());
|
||||
int cpt=0;
|
||||
//double test to assure getNumberOfQueen works
|
||||
for(int i = 0; i< Chessboard.SIZE ;i++){
|
||||
for(int j = 0; j< Chessboard.SIZE ;j++){
|
||||
if(this.chessboard.getTile(i, j) == 1){
|
||||
cpt += 1;
|
||||
; }
|
||||
}
|
||||
}
|
||||
assertEquals(3, cpt);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -81,7 +91,7 @@ class ChessboardTest {
|
||||
assertEquals(Chessboard.SIZE, chessboard.getNumberOfQueen(),"Devrait etre egal a "+Chessboard.SIZE);
|
||||
for(int i = 0; i< Chessboard.SIZE ;i++){
|
||||
for(int j = 0; j< Chessboard.SIZE ;j++){
|
||||
if(chessboard.gameBoard[i][j] != 0){
|
||||
if(chessboard.getTile(i,j) != 0){
|
||||
chessboard.removeQueen(i,j);
|
||||
assertTrue(chessboard.VerifAccessible(i,j));
|
||||
chessboard.placeQueen(i,j);
|
||||
|
Reference in New Issue
Block a user