mirror of
https://github.com/ppy/osu.git
synced 2025-01-28 09:02:58 +08:00
Add test coverage
This commit is contained in:
parent
a2d3f20409
commit
7b368dca35
@ -465,6 +465,43 @@ namespace osu.Game.Tests.Visual.SongSelect
|
|||||||
AddAssert("carousel still correct", () => songSelect.Carousel.SelectedBeatmap.OnlineBeatmapID == target.OnlineBeatmapID);
|
AddAssert("carousel still correct", () => songSelect.Carousel.SelectedBeatmap.OnlineBeatmapID == target.OnlineBeatmapID);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void TestExternalBeatmapChangeWhileFilteredThenRefilter()
|
||||||
|
{
|
||||||
|
createSongSelect();
|
||||||
|
addManyTestMaps();
|
||||||
|
|
||||||
|
changeRuleset(0);
|
||||||
|
|
||||||
|
AddUntilStep("has selection", () => songSelect.Carousel.SelectedBeatmap != null);
|
||||||
|
|
||||||
|
AddStep("set filter text", () => songSelect.FilterControl.ChildrenOfType<SearchTextBox>().First().Text = "nonono");
|
||||||
|
|
||||||
|
AddUntilStep("dummy selected", () => Beatmap.Value is DummyWorkingBeatmap);
|
||||||
|
|
||||||
|
AddUntilStep("has no selection", () => songSelect.Carousel.SelectedBeatmap == null);
|
||||||
|
|
||||||
|
BeatmapInfo target = null;
|
||||||
|
|
||||||
|
AddStep("select beatmap externally", () =>
|
||||||
|
{
|
||||||
|
target = manager.GetAllUsableBeatmapSets().Where(b => b.Beatmaps.Any(bi => bi.RulesetID == 1))
|
||||||
|
.ElementAt(5).Beatmaps.First();
|
||||||
|
|
||||||
|
Beatmap.Value = manager.GetWorkingBeatmap(target);
|
||||||
|
});
|
||||||
|
|
||||||
|
AddUntilStep("has selection", () => songSelect.Carousel.SelectedBeatmap != null);
|
||||||
|
|
||||||
|
AddUntilStep("carousel has correct", () => songSelect.Carousel.SelectedBeatmap?.OnlineBeatmapID == target.OnlineBeatmapID);
|
||||||
|
AddUntilStep("game has correct", () => Beatmap.Value.BeatmapInfo.OnlineBeatmapID == target.OnlineBeatmapID);
|
||||||
|
|
||||||
|
AddStep("set filter text", () => songSelect.FilterControl.ChildrenOfType<SearchTextBox>().First().Text = "nononoo");
|
||||||
|
|
||||||
|
AddUntilStep("game lost selection", () => Beatmap.Value is DummyWorkingBeatmap);
|
||||||
|
AddAssert("carousel lost selection", () => songSelect.Carousel.SelectedBeatmap == null);
|
||||||
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
public void TestAutoplayViaCtrlEnter()
|
public void TestAutoplayViaCtrlEnter()
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user