1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 17:47:29 +08:00

Added test

This commit is contained in:
ProTheory8 2020-01-21 10:26:51 +00:00
parent 61d7b63914
commit b8d2012fc3

View File

@ -25,6 +25,8 @@ namespace osu.Game.Tests.Visual.UserInterface
private readonly Mod testCustomisableMod = new TestModCustomisable1();
private readonly Mod testCustomisableAutoOpenMod = new TestModCustomisable3();
[Test]
public void TestButtonShowsOnCustomisableMod()
{
@ -53,6 +55,16 @@ namespace osu.Game.Tests.Visual.UserInterface
AddAssert("button enabled", () => modSelect.CustomiseButton.Enabled.Value);
}
[Test]
public void TestCustomisationOpensOnModSelect()
{
createModSelect();
AddStep("open", () => modSelect.Show());
AddStep("select mod", () => modSelect.SelectMod(testCustomisableAutoOpenMod));
AddAssert("Customisation opened", () => modSelect.ModSettingsContainer.Alpha == 1);
}
private void createModSelect()
{
AddStep("create mod select", () =>
@ -98,7 +110,8 @@ namespace osu.Game.Tests.Visual.UserInterface
return new Mod[]
{
new TestModCustomisable1(),
new TestModCustomisable2()
new TestModCustomisable2(),
new TestModCustomisable3()
};
}
@ -130,6 +143,15 @@ namespace osu.Game.Tests.Visual.UserInterface
public override string Acronym => "CM2";
}
private class TestModCustomisable3 : TestModCustomisable
{
public override string Name => "Customisable Mod 3";
public override string Acronym => "CM3";
public override bool RequiresConfiguration => true;
}
private abstract class TestModCustomisable : Mod, IApplicableMod
{
public override double ScoreMultiplier => 1.0;