fix(lobby): ready status anzeigen und Spielstart absichern
This commit is contained in:
@@ -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]
|
||||
|
||||
Reference in New Issue
Block a user