mirror of
https://github.com/ppy/osu.git
synced 2024-11-11 11:37:28 +08:00
Add coverage for the unordered case
This commit is contained in:
parent
dd2f63f313
commit
7b6e53680c
@ -18,15 +18,19 @@ namespace osu.Game.Tests.Mods
|
|||||||
|
|
||||||
var orderedSettings = objectWithSettings.GetOrderedSettingsSourceProperties().ToArray();
|
var orderedSettings = objectWithSettings.GetOrderedSettingsSourceProperties().ToArray();
|
||||||
|
|
||||||
Assert.That(orderedSettings, Has.Length.EqualTo(3));
|
Assert.That(orderedSettings, Has.Length.EqualTo(4));
|
||||||
|
|
||||||
Assert.That(orderedSettings[0].Item2.Name, Is.EqualTo(nameof(ClassWithSettings.FirstSetting)));
|
Assert.That(orderedSettings[0].Item2.Name, Is.EqualTo(nameof(ClassWithSettings.FirstSetting)));
|
||||||
Assert.That(orderedSettings[1].Item2.Name, Is.EqualTo(nameof(ClassWithSettings.SecondSetting)));
|
Assert.That(orderedSettings[1].Item2.Name, Is.EqualTo(nameof(ClassWithSettings.SecondSetting)));
|
||||||
Assert.That(orderedSettings[2].Item2.Name, Is.EqualTo(nameof(ClassWithSettings.ThirdSetting)));
|
Assert.That(orderedSettings[2].Item2.Name, Is.EqualTo(nameof(ClassWithSettings.ThirdSetting)));
|
||||||
|
Assert.That(orderedSettings[3].Item2.Name, Is.EqualTo(nameof(ClassWithSettings.UnorderedSetting)));
|
||||||
}
|
}
|
||||||
|
|
||||||
private class ClassWithSettings
|
private class ClassWithSettings
|
||||||
{
|
{
|
||||||
|
[SettingSource("Unordered setting", "Should be last")]
|
||||||
|
public BindableFloat UnorderedSetting { get; set; } = new BindableFloat();
|
||||||
|
|
||||||
[SettingSource("Second setting", "Another description", 2)]
|
[SettingSource("Second setting", "Another description", 2)]
|
||||||
public BindableBool SecondSetting { get; set; } = new BindableBool();
|
public BindableBool SecondSetting { get; set; } = new BindableBool();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user