Skip to content

Commit

Permalink
MultiplayerSession Unit Tests - GameService
Browse files Browse the repository at this point in the history
  • Loading branch information
RicardoDiNu committed Apr 26, 2024
1 parent 704843a commit ba731ef
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/test/java/com/uniovi/Wiq_UnitTests.java
Original file line number Diff line number Diff line change
Expand Up @@ -1703,6 +1703,26 @@ public void testScoreMultiplayerCodeAssignment() {
Assertions.assertEquals("200", scoreMultiplayerCode);
}

@Test
@Order(106)
public void GameSessionImpl_startNewMultiplayerGame() throws InterruptedException, IOException {
sampleDataService.insertSampleQuestions();
sampleDataService.generateSampleData();

Long playerId = 1L;
Player player = createPlayer();
player.setId(playerId);

String code = "123";
playerRepository.findById(playerId);
multiplayerSessionService.multiCreate(code, playerId);

GameSession multiplayerGame = gameSessionService.startNewMultiplayerGame(player, 123);

Assertions.assertNotNull(multiplayerGame);
Assertions.assertEquals(player, multiplayerGame.getPlayer());
}


/**
* Sends an HTTP request to the API
Expand Down

0 comments on commit ba731ef

Please sign in to comment.