Skip to content

Commit

Permalink
test: change moverequest from moving white horse to black horse
Browse files Browse the repository at this point in the history
  • Loading branch information
JonBergland committed Jul 16, 2024
1 parent 78526b8 commit 79d7fd3
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions backend/src/test/java/board/master/service/GameServiceTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -169,17 +169,24 @@ void testBotMoveChess() {
}

@Test
@DisplayName("Test of multiple botMove with Chess")
public void testLetBotMoveSeveralTime() {
String gameType = "chess";
String botType = "random";
GameStartRequest request = new GameStartRequest(botType, gameType);
GameResponse response = gameService.startGame(request);
gameIdOfGameInService = response.getGameId();
// Let the bot move several times
for (int i = 0; i < 3; i++) {
MoveRequest moveHorse = new MoveRequest(gameIdOfGameInService, "71", "50");
MoveRequest moveHorseBack = new MoveRequest(gameIdOfGameInService, "50", "71");
MoveRequest moveHorse = new MoveRequest(gameIdOfGameInService, "01", "20");
MoveRequest moveHorseBack = new MoveRequest(gameIdOfGameInService, "20", "01");

gameService.botMove(gameIdOfGameInService);
gameService.playerMove(moveHorse);
gameService.botMove(gameIdOfGameInService);
gameService.playerMove(moveHorseBack);
}
System.out.println("Test of multiple botMove with Chess done");
}
@Test
@DisplayName("Test of valid request with non-existing gameId")
Expand Down

0 comments on commit 79d7fd3

Please sign in to comment.