1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-22 06:47:24 +08:00

Add failing test case

This commit is contained in:
Salman Ahmed 2022-07-30 18:50:41 +03:00
parent 471a06883a
commit b95aff3e5f

View File

@ -10,6 +10,7 @@ using NUnit.Framework;
using osu.Framework.Allocation;
using osu.Framework.Audio;
using osu.Framework.Bindables;
using osu.Framework.Extensions.IEnumerableExtensions;
using osu.Framework.Graphics.Containers;
using osu.Framework.Platform;
using osu.Framework.Screens;
@ -282,6 +283,28 @@ namespace osu.Game.Tests.Visual.SongSelect
AddAssert("filter count is 2", () => songSelect.FilterCount == 2);
}
[Test]
public void TestCarouselSelectionUpdatesOnResume()
{
addRulesetImportStep(0);
createSongSelect();
AddStep("push child screen", () => Stack.Push(new TestSceneOsuScreenStack.TestScreen("test child")));
AddUntilStep("wait for not current", () => !songSelect.IsCurrentScreen());
AddStep("update beatmap", () =>
{
var selectedBeatmap = Beatmap.Value.BeatmapInfo;
var anotherBeatmap = Beatmap.Value.BeatmapSetInfo.Beatmaps.Except(selectedBeatmap.Yield()).First();
Beatmap.Value = manager.GetWorkingBeatmap(anotherBeatmap);
});
AddStep("return", () => songSelect.MakeCurrent());
AddUntilStep("wait for current", () => songSelect.IsCurrentScreen());
AddAssert("carousel updated", () => songSelect.Carousel.SelectedBeatmapInfo.Equals(Beatmap.Value.BeatmapInfo));
}
[Test]
public void TestAudioResuming()
{