You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
83 lines
1.2 KiB
83 lines
1.2 KiB
package MorpionCheckLine;
|
|
|
|
import static org.junit.jupiter.api.Assertions.*;
|
|
|
|
import org.junit.jupiter.api.Test;
|
|
|
|
import Morpion.Game;
|
|
|
|
class CheckLine {
|
|
|
|
@Test
|
|
void CheckLineDiagonaleJ1(){
|
|
|
|
Game game = new Game();
|
|
|
|
int tab[][] = {{1,0,0},
|
|
{0,1,0},
|
|
{0,0,1}};
|
|
|
|
assertEquals(1,game.checkLine(tab));
|
|
}
|
|
|
|
@Test
|
|
void CheckLineDiagonaleJ2(){
|
|
|
|
Game game = new Game();
|
|
|
|
int tab[][] = {{2,0,0},
|
|
{0,2,0},
|
|
{0,0,2}};
|
|
|
|
assertEquals(2,game.checkLine(tab));
|
|
}
|
|
|
|
@Test
|
|
void CheckLineHorizontaleJ1(){
|
|
|
|
Game game = new Game();
|
|
|
|
int tab[][] = {{1,1,1},
|
|
{0,0,0},
|
|
{0,0,0}};
|
|
|
|
assertEquals(1,game.checkLine(tab));
|
|
}
|
|
|
|
@Test
|
|
void CheckLineHorizontaleJ2(){
|
|
|
|
Game game = new Game();
|
|
|
|
int tab[][] = {{2,2,2},
|
|
{0,0,0},
|
|
{0,0,0}};
|
|
|
|
assertEquals(2,game.checkLine(tab));
|
|
}
|
|
|
|
@Test
|
|
void CheckLineVerticaleJ1(){
|
|
|
|
Game game = new Game();
|
|
|
|
int tab[][] = {{1,0,0},
|
|
{1,0,0},
|
|
{1,0,0}};
|
|
|
|
assertEquals(1,game.checkLine(tab));
|
|
}
|
|
|
|
@Test
|
|
void CheckLineVerticaleJ2(){
|
|
|
|
Game game = new Game();
|
|
|
|
int tab[][] = {{2,0,0},
|
|
{2,0,0},
|
|
{2,0,0}};
|
|
|
|
assertEquals(2,game.checkLine(tab));
|
|
}
|
|
}
|