Skip to content

Commit

Permalink
MultiplayerSession Unit Tests - QuestionService
Browse files Browse the repository at this point in the history
  • Loading branch information
RicardoDiNu committed Apr 26, 2024
1 parent ba731ef commit e0f6fd7
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 @@ -1723,6 +1723,26 @@ public void GameSessionImpl_startNewMultiplayerGame() throws InterruptedExcepti
Assertions.assertEquals(player, multiplayerGame.getPlayer());
}

@Test
@Order(107)
public void testRandomMultiplayerQuestions() 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);


List<Question> questions = questionService.getRandomMultiplayerQuestions(5, 123);

Assertions.assertEquals(5,questions.size());
}


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

0 comments on commit e0f6fd7

Please sign in to comment.