mirror of
https://github.com/ppy/osu.git
synced 2024-11-14 17:57:38 +08:00
Added test
This commit is contained in:
parent
61d7b63914
commit
b8d2012fc3
@ -25,6 +25,8 @@ namespace osu.Game.Tests.Visual.UserInterface
|
|||||||
|
|
||||||
private readonly Mod testCustomisableMod = new TestModCustomisable1();
|
private readonly Mod testCustomisableMod = new TestModCustomisable1();
|
||||||
|
|
||||||
|
private readonly Mod testCustomisableAutoOpenMod = new TestModCustomisable3();
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
public void TestButtonShowsOnCustomisableMod()
|
public void TestButtonShowsOnCustomisableMod()
|
||||||
{
|
{
|
||||||
@ -53,6 +55,16 @@ namespace osu.Game.Tests.Visual.UserInterface
|
|||||||
AddAssert("button enabled", () => modSelect.CustomiseButton.Enabled.Value);
|
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()
|
private void createModSelect()
|
||||||
{
|
{
|
||||||
AddStep("create mod select", () =>
|
AddStep("create mod select", () =>
|
||||||
@ -98,7 +110,8 @@ namespace osu.Game.Tests.Visual.UserInterface
|
|||||||
return new Mod[]
|
return new Mod[]
|
||||||
{
|
{
|
||||||
new TestModCustomisable1(),
|
new TestModCustomisable1(),
|
||||||
new TestModCustomisable2()
|
new TestModCustomisable2(),
|
||||||
|
new TestModCustomisable3()
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -130,6 +143,15 @@ namespace osu.Game.Tests.Visual.UserInterface
|
|||||||
public override string Acronym => "CM2";
|
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
|
private abstract class TestModCustomisable : Mod, IApplicableMod
|
||||||
{
|
{
|
||||||
public override double ScoreMultiplier => 1.0;
|
public override double ScoreMultiplier => 1.0;
|
||||||
|
Loading…
Reference in New Issue
Block a user