Add test coverage for localisable setting source

This commit is contained in:
naoei 2022-08-14 15:03:05 -04:00
parent 45e9eda9e7
commit 784ce4d23d
1 changed files with 10 additions and 0 deletions

View File

@ -7,6 +7,7 @@
using osu.Framework.Bindables;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Localisation;
using osu.Game.Configuration;
using osu.Game.Overlays.Settings;
using osuTK;
@ -39,6 +40,9 @@ private class TestTargetClass
[SettingSource("Sample bool", "Clicking this changes a setting")]
public BindableBool TickBindable { get; } = new BindableBool();
[SettingSource(typeof(TestStrings), nameof(TestStrings.LocalisableLabel), nameof(TestStrings.LocalisableDescription))]
public BindableBool LocalisableBindable { get; } = new BindableBool(true);
[SettingSource("Sample float", "Change something for a mod")]
public BindableFloat SliderBindable { get; } = new BindableFloat
{
@ -75,5 +79,11 @@ private enum TestEnum
Value1,
Value2
}
private class TestStrings
{
public static LocalisableString LocalisableLabel => new LocalisableString("Sample localisable label");
public static LocalisableString LocalisableDescription => new LocalisableString("Sample localisable description");
}
}
}