1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-12 22:33:05 +08:00

Add test coverage of mass multiplayer event firing

This commit is contained in:
Dean Herbert 2021-08-27 18:57:35 +09:00
parent 2b06dacd0e
commit 97f27897b1

View File

@ -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()