Added test

This commit is contained in:
ProTheory8 2020-01-21 10:26:51 +00:00
parent 61d7b63914
commit b8d2012fc3
1 changed files with 23 additions and 1 deletions

View File

@ -25,6 +25,8 @@ public class TestSceneModSettings : OsuTestScene
private readonly Mod testCustomisableMod = new TestModCustomisable1();
private readonly Mod testCustomisableAutoOpenMod = new TestModCustomisable3();
[Test]
public void TestButtonShowsOnCustomisableMod()
{
@ -53,6 +55,16 @@ public void TestButtonShowsOnModAlreadyAdded()
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 @@ public override IEnumerable<Mod> GetModsFor(ModType type)
return new Mod[]
{
new TestModCustomisable1(),
new TestModCustomisable2()
new TestModCustomisable2(),
new TestModCustomisable3()
};
}
@ -130,6 +143,15 @@ private class TestModCustomisable2 : TestModCustomisable
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;