From 97f27897b13ba271ca89db32a2126a754629abe8 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 27 Aug 2021 18:57:35 +0900 Subject: [PATCH] Add test coverage of mass multiplayer event firing --- .../Visual/Multiplayer/TestSceneMultiplayer.cs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/osu.Game.Tests/Visual/Multiplayer/TestSceneMultiplayer.cs b/osu.Game.Tests/Visual/Multiplayer/TestSceneMultiplayer.cs index d84fe4b6fb..22338bad84 100644 --- a/osu.Game.Tests/Visual/Multiplayer/TestSceneMultiplayer.cs +++ b/osu.Game.Tests/Visual/Multiplayer/TestSceneMultiplayer.cs @@ -2,6 +2,7 @@ // See the LICENCE file in the repository root for full licence text. using System; +using System.Diagnostics; using System.Linq; using NUnit.Framework; using osu.Framework.Allocation; @@ -125,6 +126,20 @@ namespace osu.Game.Tests.Visual.Multiplayer return client.Room?.Users.All(u => u.State == MultiplayerUserState.Ready) == true; }); + + AddStep("unready all players at once", () => + { + Debug.Assert(client.Room != null); + + foreach (var u in client.Room.Users) client.ChangeUserState(u.UserID, MultiplayerUserState.Idle); + }); + + AddStep("ready all players at once", () => + { + Debug.Assert(client.Room != null); + + foreach (var u in client.Room.Users) client.ChangeUserState(u.UserID, MultiplayerUserState.Ready); + }); } private void addRandomPlayer()