Add better test coverage of dual stages in skinnable tests

This commit is contained in:
Bartłomiej Dach 2023-06-17 10:25:09 +02:00
parent f70342bd67
commit 688e65475d
No known key found for this signature in database

View File

@ -8,6 +8,7 @@ using NUnit.Framework;
using osu.Game.Beatmaps;
using osu.Game.Rulesets.Mania.Beatmaps;
using osu.Game.Rulesets.Mania.UI;
using osuTK;
namespace osu.Game.Rulesets.Mania.Tests.Skinning
{
@ -25,22 +26,35 @@ namespace osu.Game.Rulesets.Mania.Tests.Skinning
new StageDefinition(2)
};
SetContents(_ => new ManiaPlayfield(stageDefinitions));
SetContents(_ => new ManiaInputManager(new ManiaRuleset().RulesetInfo, 2)
{
Child = new ManiaPlayfield(stageDefinitions)
});
});
}
[Test]
public void TestDualStages()
[TestCase(2)]
[TestCase(3)]
[TestCase(5)]
public void TestDualStages(int columnCount)
{
AddStep("create stage", () =>
{
stageDefinitions = new List<StageDefinition>
{
new StageDefinition(2),
new StageDefinition(2)
new StageDefinition(columnCount),
new StageDefinition(columnCount)
};
SetContents(_ => new ManiaPlayfield(stageDefinitions));
SetContents(_ => new ManiaInputManager(new ManiaRuleset().RulesetInfo, (int)PlayfieldType.Dual + 2 * columnCount)
{
Child = new ManiaPlayfield(stageDefinitions)
{
// bit of a hack to make sure the dual stages fit on screen without overlapping each other.
Size = new Vector2(1.5f),
Scale = new Vector2(1 / 1.5f)
}
});
});
}