Update `TestIncompatibilityDisplay` in line with new functionality

This commit is contained in:
Dean Herbert 2022-04-22 16:22:12 +09:00
parent cd898344cb
commit 14e17c8b7b
1 changed files with 15 additions and 10 deletions

View File

@ -47,12 +47,22 @@ public void TestIncompatibilityDisplay()
{
IncompatibilityDisplayingModPanel panel = null;
AddStep("create panel with DT", () => Child = panel = new IncompatibilityDisplayingModPanel(new OsuModDoubleTime())
AddStep("create panel with DT", () =>
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
RelativeSizeAxes = Axes.None,
Width = 300
Child = panel = new IncompatibilityDisplayingModPanel(new OsuModDoubleTime())
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
RelativeSizeAxes = Axes.None,
Width = 300,
};
panel.Active.BindValueChanged(active =>
{
SelectedMods.Value = active.NewValue
? Array.Empty<Mod>()
: new[] { panel.Mod };
});
});
clickPanel();
@ -63,11 +73,6 @@ public void TestIncompatibilityDisplay()
AddStep("set incompatible mod", () => SelectedMods.Value = new[] { new OsuModHalfTime() });
clickPanel();
AddAssert("panel not active", () => !panel.Active.Value);
AddStep("reset mods", () => SelectedMods.Value = Array.Empty<Mod>());
clickPanel();
AddAssert("panel active", () => panel.Active.Value);