mirror of
https://github.com/ppy/osu.git
synced 2025-01-14 20:32:55 +08:00
Add test coverage
This commit is contained in:
parent
7aac0e59a8
commit
c0c1f2c023
@ -54,6 +54,35 @@ namespace osu.Game.Tests.Visual.SongSelect
|
|||||||
this.rulesets = rulesets;
|
this.rulesets = rulesets;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void TestRecommendedSelection()
|
||||||
|
{
|
||||||
|
loadBeatmaps();
|
||||||
|
|
||||||
|
AddStep("set recommendation function", () => carousel.GetRecommendedBeatmap = beatmaps => beatmaps.LastOrDefault());
|
||||||
|
|
||||||
|
// check recommended was selected
|
||||||
|
advanceSelection(direction: 1, diff: false);
|
||||||
|
waitForSelection(1, 3);
|
||||||
|
|
||||||
|
// change away from recommended
|
||||||
|
advanceSelection(direction: -1, diff: true);
|
||||||
|
waitForSelection(1, 2);
|
||||||
|
|
||||||
|
// next set, check recommended
|
||||||
|
advanceSelection(direction: 1, diff: false);
|
||||||
|
waitForSelection(2, 3);
|
||||||
|
|
||||||
|
// next set, check recommended
|
||||||
|
advanceSelection(direction: 1, diff: false);
|
||||||
|
waitForSelection(3, 3);
|
||||||
|
|
||||||
|
// go back to first set and ensure user selection was retained
|
||||||
|
advanceSelection(direction: -1, diff: false);
|
||||||
|
advanceSelection(direction: -1, diff: false);
|
||||||
|
waitForSelection(1, 2);
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Test keyboard traversal
|
/// Test keyboard traversal
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
Loading…
Reference in New Issue
Block a user