mirror of
https://github.com/osukey/osukey.git
synced 2025-08-05 23:53:51 +09:00
Add test coverage for localisable setting source
This commit is contained in:
@ -7,6 +7,7 @@ using NUnit.Framework;
|
|||||||
using osu.Framework.Bindables;
|
using osu.Framework.Bindables;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
|
using osu.Framework.Localisation;
|
||||||
using osu.Game.Configuration;
|
using osu.Game.Configuration;
|
||||||
using osu.Game.Overlays.Settings;
|
using osu.Game.Overlays.Settings;
|
||||||
using osuTK;
|
using osuTK;
|
||||||
@ -39,6 +40,9 @@ namespace osu.Game.Tests.Visual.Settings
|
|||||||
[SettingSource("Sample bool", "Clicking this changes a setting")]
|
[SettingSource("Sample bool", "Clicking this changes a setting")]
|
||||||
public BindableBool TickBindable { get; } = new BindableBool();
|
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")]
|
[SettingSource("Sample float", "Change something for a mod")]
|
||||||
public BindableFloat SliderBindable { get; } = new BindableFloat
|
public BindableFloat SliderBindable { get; } = new BindableFloat
|
||||||
{
|
{
|
||||||
@ -75,5 +79,11 @@ namespace osu.Game.Tests.Visual.Settings
|
|||||||
Value1,
|
Value1,
|
||||||
Value2
|
Value2
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private class TestStrings
|
||||||
|
{
|
||||||
|
public static LocalisableString LocalisableLabel => new LocalisableString("Sample localisable label");
|
||||||
|
public static LocalisableString LocalisableDescription => new LocalisableString("Sample localisable description");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user