1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-13 16:32:54 +08:00

Fix TestCasePlaySongSelect

This commit is contained in:
Dean Herbert 2019-02-15 21:50:40 +09:00
parent 4777fd1334
commit aceb8c4cb0

View File

@ -103,22 +103,16 @@ namespace osu.Game.Tests.Visual
}
[SetUp]
public virtual void SetUp()
{
Schedule(() =>
{
manager?.Delete(manager.GetAllUsableBeatmapSets());
LoadScreen(songSelect = new TestSongSelect());
AddUntilStep(() => songSelect.IsPresent, "wait for present");
});
}
public virtual void SetUp() =>
Schedule(() => { manager?.Delete(manager.GetAllUsableBeatmapSets()); });
[Test]
public void TestDummy()
{
createSongSelect();
AddAssert("dummy selected", () => songSelect.CurrentBeatmap == defaultBeatmap);
AddAssert("dummy shown on wedge", () => songSelect.CurrentBeatmapDetailsBeatmap == defaultBeatmap);
AddUntilStep(() => songSelect.CurrentBeatmapDetailsBeatmap == defaultBeatmap, "dummy shown on wedge");
addManyTestMaps();
AddWaitStep(3);
@ -129,6 +123,7 @@ namespace osu.Game.Tests.Visual
[Test]
public void TestSorting()
{
createSongSelect();
addManyTestMaps();
AddWaitStep(3);
@ -144,6 +139,7 @@ namespace osu.Game.Tests.Visual
[Ignore("needs fixing")]
public void TestImportUnderDifferentRuleset()
{
createSongSelect();
changeRuleset(2);
importForRuleset(0);
AddUntilStep(() => songSelect.Carousel.SelectedBeatmap == null, "no selection");
@ -152,6 +148,7 @@ namespace osu.Game.Tests.Visual
[Test]
public void TestImportUnderCurrentRuleset()
{
createSongSelect();
changeRuleset(2);
importForRuleset(2);
importForRuleset(1);
@ -167,6 +164,7 @@ namespace osu.Game.Tests.Visual
[Test]
public void TestRulesetChangeResetsMods()
{
createSongSelect();
changeRuleset(0);
changeMods(new OsuModHardRock());
@ -196,6 +194,7 @@ namespace osu.Game.Tests.Visual
[Test]
public void TestStartAfterUnMatchingFilterDoesNotStart()
{
createSongSelect();
addManyTestMaps();
AddUntilStep(() => songSelect.Carousel.SelectedBeatmap != null, "has selection");
@ -223,6 +222,12 @@ namespace osu.Game.Tests.Visual
private void changeRuleset(int id) => AddStep($"change ruleset to {id}", () => Ruleset.Value = rulesets.AvailableRulesets.First(r => r.ID == id));
private void createSongSelect()
{
AddStep("create song select", () => LoadScreen(songSelect = new TestSongSelect()));
AddUntilStep(() => songSelect.IsCurrentScreen(), "wait for present");
}
private void addManyTestMaps()
{
AddStep("import test maps", () =>