2018-01-05 19:21:19 +08:00
|
|
|
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
2017-11-30 14:43:19 +08:00
|
|
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
|
|
|
|
|
|
|
using System;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using osu.Framework.Graphics;
|
|
|
|
using osu.Game.Screens.Edit.Screens.Compose.RadioButtons;
|
|
|
|
|
|
|
|
namespace osu.Game.Tests.Visual
|
|
|
|
{
|
|
|
|
public class TestCaseEditorComposeRadioButtons : OsuTestCase
|
|
|
|
{
|
|
|
|
public override IReadOnlyList<Type> RequiredTypes => new[] { typeof(DrawableRadioButton) };
|
|
|
|
|
|
|
|
public TestCaseEditorComposeRadioButtons()
|
|
|
|
{
|
2017-11-30 18:49:55 +08:00
|
|
|
RadioButtonCollection collection;
|
|
|
|
Add(collection = new RadioButtonCollection
|
2017-11-30 14:43:19 +08:00
|
|
|
{
|
|
|
|
Anchor = Anchor.Centre,
|
|
|
|
Origin = Anchor.Centre,
|
|
|
|
Width = 150,
|
|
|
|
Items = new[]
|
|
|
|
{
|
2017-11-30 15:57:30 +08:00
|
|
|
new RadioButton("Item 1", () => { }),
|
|
|
|
new RadioButton("Item 2", () => { }),
|
|
|
|
new RadioButton("Item 3", () => { }),
|
|
|
|
new RadioButton("Item 4", () => { }),
|
|
|
|
new RadioButton("Item 5", () => { })
|
2017-11-30 14:43:19 +08:00
|
|
|
}
|
|
|
|
});
|
2017-11-30 18:49:55 +08:00
|
|
|
|
|
|
|
for (int i = 0; i < collection.Items.Count; i++)
|
|
|
|
{
|
|
|
|
int l = i;
|
|
|
|
AddStep($"Select item {l + 1}", () => collection.Items[l].Select());
|
|
|
|
AddStep($"Deselect item {l + 1}", () => collection.Items[l].Deselect());
|
|
|
|
}
|
2017-11-30 14:43:19 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|