From 231afbf4636fd4e8b1fcca19de4d97e8fda0dc9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Fri, 23 May 2025 09:48:34 +0200 Subject: [PATCH] Fix tests post-pooling implementation --- .../TestSceneMultiplayerParticipantsList.cs | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/osu.Game.Tests/Visual/Multiplayer/TestSceneMultiplayerParticipantsList.cs b/osu.Game.Tests/Visual/Multiplayer/TestSceneMultiplayerParticipantsList.cs index b8b144066f..0014d8b88d 100644 --- a/osu.Game.Tests/Visual/Multiplayer/TestSceneMultiplayerParticipantsList.cs +++ b/osu.Game.Tests/Visual/Multiplayer/TestSceneMultiplayerParticipantsList.cs @@ -163,13 +163,17 @@ namespace osu.Game.Tests.Visual.Multiplayer CoverUrl = TestResources.COVER_IMAGE_3, })); - AddUntilStep("first user crown visible", () => this.ChildrenOfType().ElementAt(0).ChildrenOfType().First().Alpha == 1); - AddUntilStep("second user crown hidden", () => this.ChildrenOfType().ElementAt(1).ChildrenOfType().First().Alpha == 0); + AddUntilStep("first user crown visible", + () => this.ChildrenOfType().Single(p => p.Current.Value.UserID == 1001).ChildrenOfType().First().Alpha == 1); + AddUntilStep("second user crown hidden", + () => this.ChildrenOfType().Single(p => p.Current.Value.UserID == 3).ChildrenOfType().First().Alpha == 0); AddStep("make second user host", () => MultiplayerClient.TransferHost(3)); - AddUntilStep("first user crown hidden", () => this.ChildrenOfType().ElementAt(0).ChildrenOfType().First().Alpha == 0); - AddUntilStep("second user crown visible", () => this.ChildrenOfType().ElementAt(1).ChildrenOfType().First().Alpha == 1); + AddUntilStep("first user crown visible", + () => this.ChildrenOfType().Single(p => p.Current.Value.UserID == 1001).ChildrenOfType().First().Alpha == 0); + AddUntilStep("second user crown hidden", + () => this.ChildrenOfType().Single(p => p.Current.Value.UserID == 3).ChildrenOfType().First().Alpha == 1); } [Test] @@ -185,9 +189,9 @@ namespace osu.Game.Tests.Visual.Multiplayer AddStep("make second user host", () => MultiplayerClient.TransferHost(3)); AddAssert("second user above first", () => { - var first = this.ChildrenOfType().ElementAt(0); - var second = this.ChildrenOfType().ElementAt(1); - return second.Y < first.Y; + var first = this.ChildrenOfType().Single(u => u.Current.Value.UserID == 1001); + var second = this.ChildrenOfType().Single(u => u.Current.Value.UserID == 3); + return second.ScreenSpaceDrawQuad.TopLeft.Y < first.ScreenSpaceDrawQuad.TopLeft.Y; }); }