fix(lobby): ready status anzeigen und Spielstart absichern

This commit is contained in:
Tim Krampitz
2026-09-10 21:52:21 +02:00
parent 01e62652f5
commit 01b6a41bc6
6 changed files with 43 additions and 6 deletions

View File

@@ -104,11 +104,18 @@ public class GameHubTests
var game = new Game { Id = 7, LobbyCode = "XYZ789", HostId = user.Id };
_gameService.Setup(s => s.CreateGameAsync(user.Id, ConnectionId)).ReturnsAsync(game);
_gameService.Setup(s => s.GetGameStateAsync(game.Id)).ReturnsAsync(new GameStateDto
{
GameId = game.Id,
LobbyCode = game.LobbyCode,
Players = [new PlayerInfoDto { Username = user.Username }]
});
await _hub.CreateLobby();
_groups.Verify(g => g.AddToGroupAsync(ConnectionId, "XYZ789", default), Times.Once);
_callerProxy.Verify(p => p.SendCoreAsync("LobbyCreated", It.Is<object?[]>(a => a.Length == 1), default), Times.Once);
_callerProxy.Verify(p => p.SendCoreAsync("PlayerJoined", It.Is<object?[]>(a => a.Length == 1), default), Times.Once);
}
[Fact]