From 79d7fd3da4f73b885612f5574e63dc20cca7440e Mon Sep 17 00:00:00 2001 From: Jon Bergland Date: Tue, 16 Jul 2024 13:20:58 +0200 Subject: [PATCH] test: change moverequest from moving white horse to black horse --- .../java/board/master/service/GameServiceTest.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/backend/src/test/java/board/master/service/GameServiceTest.java b/backend/src/test/java/board/master/service/GameServiceTest.java index 94e93ba..e032f92 100644 --- a/backend/src/test/java/board/master/service/GameServiceTest.java +++ b/backend/src/test/java/board/master/service/GameServiceTest.java @@ -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")