Fix potential test failures due to Setup/SetUpSteps ordering

This commit is contained in:
Dan Balasescu
2022-07-29 15:27:39 +09:00
parent bc685918b6
commit aaa6f963bd
15 changed files with 258 additions and 221 deletions

View File

@ -46,43 +46,47 @@ namespace osu.Game.Tests.Visual.Multiplayer
beatmaps.Import(TestResources.GetQuickTestBeatmapForImport()).WaitSafely();
}
[SetUp]
public new void Setup() => Schedule(() =>
public override void SetUpSteps()
{
AvailabilityTracker.SelectedItem.BindTo(selectedItem);
base.SetUpSteps();
importedSet = beatmaps.GetAllUsableBeatmapSets().First();
Beatmap.Value = beatmaps.GetWorkingBeatmap(importedSet.Beatmaps.First());
selectedItem.Value = new PlaylistItem(Beatmap.Value.BeatmapInfo)
AddStep("create button", () =>
{
RulesetID = Beatmap.Value.BeatmapInfo.Ruleset.OnlineID,
};
AvailabilityTracker.SelectedItem.BindTo(selectedItem);
Child = new PopoverContainer
{
RelativeSizeAxes = Axes.Both,
Child = new FillFlowContainer
importedSet = beatmaps.GetAllUsableBeatmapSets().First();
Beatmap.Value = beatmaps.GetWorkingBeatmap(importedSet.Beatmaps.First());
selectedItem.Value = new PlaylistItem(Beatmap.Value.BeatmapInfo)
{
AutoSizeAxes = Axes.Both,
Direction = FillDirection.Vertical,
Children = new Drawable[]
RulesetID = Beatmap.Value.BeatmapInfo.Ruleset.OnlineID,
};
Child = new PopoverContainer
{
RelativeSizeAxes = Axes.Both,
Child = new FillFlowContainer
{
spectateButton = new MultiplayerSpectateButton
AutoSizeAxes = Axes.Both,
Direction = FillDirection.Vertical,
Children = new Drawable[]
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
Size = new Vector2(200, 50),
},
startControl = new MatchStartControl
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
Size = new Vector2(200, 50),
spectateButton = new MultiplayerSpectateButton
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
Size = new Vector2(200, 50),
},
startControl = new MatchStartControl
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
Size = new Vector2(200, 50),
}
}
}
}
};
});
};
});
}
[TestCase(MultiplayerRoomState.Open)]
[TestCase(MultiplayerRoomState.WaitingForLoad)]