1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-21 15:27:24 +08:00

Add testing for loading operation

This commit is contained in:
Joseph Madamba 2024-09-17 20:42:43 -07:00
parent c19802e923
commit 0082910353

View File

@ -3,6 +3,7 @@
#nullable disable #nullable disable
using System;
using System.Linq; using System.Linq;
using NUnit.Framework; using NUnit.Framework;
using osu.Framework.Bindables; using osu.Framework.Bindables;
@ -23,6 +24,7 @@ namespace osu.Game.Tests.Visual.Playlists
protected new TestRoomManager RoomManager => (TestRoomManager)base.RoomManager; protected new TestRoomManager RoomManager => (TestRoomManager)base.RoomManager;
private TestLoungeSubScreen loungeScreen; private TestLoungeSubScreen loungeScreen;
private IDisposable loadingOperation;
public override void SetUpSteps() public override void SetUpSteps()
{ {
@ -104,6 +106,16 @@ namespace osu.Game.Tests.Visual.Playlists
AddStep("search for room 1", () => this.ChildrenOfType<ShearedFilterTextBox>().Single().Current.Value = "room 1"); AddStep("search for room 1", () => this.ChildrenOfType<ShearedFilterTextBox>().Single().Current.Value = "room 1");
AddUntilStep("filter text is 1 match", () => this.ChildrenOfType<ShearedFilterTextBox>().Single().FilterText.ToString(), () => Is.EqualTo("1 match")); AddUntilStep("filter text is 1 match", () => this.ChildrenOfType<ShearedFilterTextBox>().Single().FilterText.ToString(), () => Is.EqualTo("1 match"));
AddStep("begin loading operation", () => loadingOperation = OngoingOperationTracker.BeginOperation());
AddAssert("filter text is loading...", () => this.ChildrenOfType<ShearedFilterTextBox>().Single().FilterText.ToString(), () => Is.EqualTo("loading..."));
AddStep("finish loading operation", () =>
{
loadingOperation?.Dispose();
loadingOperation = null;
});
} }
private bool checkRoomVisible(DrawableRoom room) => private bool checkRoomVisible(DrawableRoom room) =>