mirror of
https://github.com/ppy/osu.git
synced 2025-01-13 15:33:21 +08:00
Extract beatmap retrieval method for more legibility
This commit is contained in:
parent
a6f0186112
commit
32f8c674f4
@ -2,7 +2,6 @@
|
|||||||
// See the LICENCE file in the repository root for full licence text.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using DeepEqual.Syntax;
|
|
||||||
using NUnit.Framework;
|
using NUnit.Framework;
|
||||||
using osu.Framework.Screens;
|
using osu.Framework.Screens;
|
||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
@ -18,10 +17,7 @@ namespace osu.Game.Tests.Visual.Navigation
|
|||||||
{
|
{
|
||||||
BeatmapSetInfo[] beatmapSets = null!;
|
BeatmapSetInfo[] beatmapSets = null!;
|
||||||
|
|
||||||
AddStep("Fetch initial beatmaps", () =>
|
AddStep("Fetch initial beatmaps", () => beatmapSets = allBeatmapSets());
|
||||||
{
|
|
||||||
beatmapSets = Game.Realm.Run(realm => realm.All<BeatmapSetInfo>().Where(x => !x.DeletePending).ToArray());
|
|
||||||
});
|
|
||||||
|
|
||||||
AddStep("Set current beatmap to default", () => Game.Beatmap.SetDefault());
|
AddStep("Set current beatmap to default", () => Game.Beatmap.SetDefault());
|
||||||
|
|
||||||
@ -30,12 +26,9 @@ namespace osu.Game.Tests.Visual.Navigation
|
|||||||
AddStep("Close editor while loading", () => Game.ScreenStack.CurrentScreen.Exit());
|
AddStep("Close editor while loading", () => Game.ScreenStack.CurrentScreen.Exit());
|
||||||
|
|
||||||
AddUntilStep("Wait for menu", () => Game.ScreenStack.CurrentScreen is MainMenu);
|
AddUntilStep("Wait for menu", () => Game.ScreenStack.CurrentScreen is MainMenu);
|
||||||
|
AddAssert("Check no new beatmaps were made", () => allBeatmapSets().SequenceEqual(beatmapSets));
|
||||||
|
|
||||||
AddAssert("Check no new beatmaps were made", () =>
|
BeatmapSetInfo[] allBeatmapSets() => Game.Realm.Run(realm => realm.All<BeatmapSetInfo>().Where(x => !x.DeletePending).ToArray());
|
||||||
{
|
|
||||||
var beatmapSetsAfter = Game.Realm.Run(realm => realm.All<BeatmapSetInfo>().Where(x => !x.DeletePending).ToArray());
|
|
||||||
return beatmapSetsAfter.SequenceEqual(beatmapSets);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user