mirror of
https://github.com/ppy/osu
synced 2025-03-01 17:11:12 +00:00
Fix test gameplay tests failing due to beatmap refetch on suspend
This commit is contained in:
parent
d760283665
commit
e0616476e2
@ -70,7 +70,11 @@ namespace osu.Game.Tests.Visual.Editing
|
||||
AddUntilStep("current screen is editor", () => Stack.CurrentScreen is Editor);
|
||||
AddUntilStep("background has correct params", () =>
|
||||
{
|
||||
var background = this.ChildrenOfType<BackgroundScreenBeatmap>().Single();
|
||||
// the test gameplay player's beatmap may be the "same" beatmap as the one being edited, *but* the `BeatmapInfo` references may differ
|
||||
// due to the beatmap refetch logic ran on editor suspend.
|
||||
// this test cares about checking the background belonging to the editor specifically, so check that using reference equality
|
||||
// (as `.Equals()` cannot discern between the two, as they technically share the same database GUID).
|
||||
var background = this.ChildrenOfType<BackgroundScreenBeatmap>().Single(b => ReferenceEquals(b.Beatmap.BeatmapInfo, EditorBeatmap.BeatmapInfo));
|
||||
return background.Colour == Color4.DarkGray && background.BlurAmount.Value == 0;
|
||||
});
|
||||
AddAssert("no mods selected", () => SelectedMods.Value.Count == 0);
|
||||
@ -99,7 +103,11 @@ namespace osu.Game.Tests.Visual.Editing
|
||||
AddUntilStep("current screen is editor", () => Stack.CurrentScreen is Editor);
|
||||
AddUntilStep("background has correct params", () =>
|
||||
{
|
||||
var background = this.ChildrenOfType<BackgroundScreenBeatmap>().Single();
|
||||
// the test gameplay player's beatmap may be the "same" beatmap as the one being edited, *but* the `BeatmapInfo` references may differ
|
||||
// due to the beatmap refetch logic ran on editor suspend.
|
||||
// this test cares about checking the background belonging to the editor specifically, so check that using reference equality
|
||||
// (as `.Equals()` cannot discern between the two, as they technically share the same database GUID).
|
||||
var background = this.ChildrenOfType<BackgroundScreenBeatmap>().Single(b => ReferenceEquals(b.Beatmap.BeatmapInfo, EditorBeatmap.BeatmapInfo));
|
||||
return background.Colour == Color4.DarkGray && background.BlurAmount.Value == 0;
|
||||
});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user