Test both ways

This commit is contained in:
Endrik Tombak 2020-03-28 13:10:20 +02:00
parent 659865b457
commit 63f6269eb0

View File

@ -83,8 +83,9 @@ namespace osu.Game.Tests.Visual.SongSelect
waitForSelection(set_count, 3);
}
[Test]
public void TestTraversalHold()
[TestCase(true)]
[TestCase(false)]
public void TestTraversalHold(bool forwards)
{
var sets = new List<BeatmapSetInfo>();
const int create_this_many_sets = 200;
@ -99,15 +100,16 @@ namespace osu.Game.Tests.Visual.SongSelect
void selectNextAndAssert(int amount)
{
setSelected(1, 1);
AddStep($"Next beatmap {amount} times", () =>
setSelected(forwards ? 1 : create_this_many_sets, 1);
string text = forwards ? "Next" : "Previous";
AddStep($"{text} beatmap {amount} times", () =>
{
for (int i = 0; i < amount; i++)
{
carousel.SelectNext();
carousel.SelectNext(forwards ? 1 : -1);
}
});
waitForSelection(amount + 1);
waitForSelection(forwards ? amount + 1 : create_this_many_sets - amount);
}
for (int i = 1; i < create_this_many_sets; i += i)