mirror of
https://github.com/ppy/osu.git
synced 2025-02-22 15:22:56 +08:00
Update tests to match expectations
This commit is contained in:
parent
04773b51bb
commit
5dc938cc9f
@ -6,6 +6,7 @@ using System.Globalization;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using NUnit.Framework;
|
using NUnit.Framework;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Framework.Graphics.UserInterface;
|
using osu.Framework.Graphics.UserInterface;
|
||||||
using osu.Framework.Testing;
|
using osu.Framework.Testing;
|
||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
@ -42,7 +43,7 @@ namespace osu.Game.Tests.Visual.Editing
|
|||||||
AddStep("turn countdown off", () => designSection.EnableCountdown.Current.Value = false);
|
AddStep("turn countdown off", () => designSection.EnableCountdown.Current.Value = false);
|
||||||
|
|
||||||
AddAssert("beatmap has correct type", () => editorBeatmap.BeatmapInfo.Countdown == CountdownType.None);
|
AddAssert("beatmap has correct type", () => editorBeatmap.BeatmapInfo.Countdown == CountdownType.None);
|
||||||
AddUntilStep("other controls hidden", () => !designSection.CountdownSpeed.IsPresent && !designSection.CountdownOffset.IsPresent);
|
AddUntilStep("other controls hidden", () => !designSection.CountdownSettings.IsPresent);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
@ -51,12 +52,12 @@ namespace osu.Game.Tests.Visual.Editing
|
|||||||
AddStep("turn countdown on", () => designSection.EnableCountdown.Current.Value = true);
|
AddStep("turn countdown on", () => designSection.EnableCountdown.Current.Value = true);
|
||||||
|
|
||||||
AddAssert("beatmap has correct type", () => editorBeatmap.BeatmapInfo.Countdown == CountdownType.Normal);
|
AddAssert("beatmap has correct type", () => editorBeatmap.BeatmapInfo.Countdown == CountdownType.Normal);
|
||||||
AddUntilStep("other controls shown", () => designSection.CountdownSpeed.IsPresent && designSection.CountdownOffset.IsPresent);
|
AddUntilStep("other controls shown", () => designSection.CountdownSettings.IsPresent);
|
||||||
|
|
||||||
AddStep("change countdown speed", () => designSection.CountdownSpeed.Current.Value = CountdownType.DoubleSpeed);
|
AddStep("change countdown speed", () => designSection.CountdownSpeed.Current.Value = CountdownType.DoubleSpeed);
|
||||||
|
|
||||||
AddAssert("beatmap has correct type", () => editorBeatmap.BeatmapInfo.Countdown == CountdownType.DoubleSpeed);
|
AddAssert("beatmap has correct type", () => editorBeatmap.BeatmapInfo.Countdown == CountdownType.DoubleSpeed);
|
||||||
AddUntilStep("other controls still shown", () => designSection.CountdownSpeed.IsPresent && designSection.CountdownOffset.IsPresent);
|
AddUntilStep("other controls still shown", () => designSection.CountdownSettings.IsPresent);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
@ -90,6 +91,8 @@ namespace osu.Game.Tests.Visual.Editing
|
|||||||
private class TestDesignSection : DesignSection
|
private class TestDesignSection : DesignSection
|
||||||
{
|
{
|
||||||
public new LabelledSwitchButton EnableCountdown => base.EnableCountdown;
|
public new LabelledSwitchButton EnableCountdown => base.EnableCountdown;
|
||||||
|
|
||||||
|
public new FillFlowContainer CountdownSettings => base.CountdownSettings;
|
||||||
public new LabelledEnumDropdown<CountdownType> CountdownSpeed => base.CountdownSpeed;
|
public new LabelledEnumDropdown<CountdownType> CountdownSpeed => base.CountdownSpeed;
|
||||||
public new LabelledNumberBox CountdownOffset => base.CountdownOffset;
|
public new LabelledNumberBox CountdownOffset => base.CountdownOffset;
|
||||||
}
|
}
|
||||||
|
@ -17,6 +17,8 @@ namespace osu.Game.Screens.Edit.Setup
|
|||||||
internal class DesignSection : SetupSection
|
internal class DesignSection : SetupSection
|
||||||
{
|
{
|
||||||
protected LabelledSwitchButton EnableCountdown;
|
protected LabelledSwitchButton EnableCountdown;
|
||||||
|
|
||||||
|
protected FillFlowContainer CountdownSettings;
|
||||||
protected LabelledEnumDropdown<CountdownType> CountdownSpeed;
|
protected LabelledEnumDropdown<CountdownType> CountdownSpeed;
|
||||||
protected LabelledNumberBox CountdownOffset;
|
protected LabelledNumberBox CountdownOffset;
|
||||||
|
|
||||||
@ -24,8 +26,6 @@ namespace osu.Game.Screens.Edit.Setup
|
|||||||
private LabelledSwitchButton epilepsyWarning;
|
private LabelledSwitchButton epilepsyWarning;
|
||||||
private LabelledSwitchButton letterboxDuringBreaks;
|
private LabelledSwitchButton letterboxDuringBreaks;
|
||||||
|
|
||||||
private FillFlowContainer countdownSettings;
|
|
||||||
|
|
||||||
public override LocalisableString Title => "Design";
|
public override LocalisableString Title => "Design";
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
@ -39,7 +39,7 @@ namespace osu.Game.Screens.Edit.Setup
|
|||||||
Current = { Value = Beatmap.BeatmapInfo.Countdown != CountdownType.None },
|
Current = { Value = Beatmap.BeatmapInfo.Countdown != CountdownType.None },
|
||||||
Description = "If enabled, an \"Are you ready? 3, 2, 1, GO!\" countdown will be inserted at the beginning of the beatmap, assuming there is enough time to do so."
|
Description = "If enabled, an \"Are you ready? 3, 2, 1, GO!\" countdown will be inserted at the beginning of the beatmap, assuming there is enough time to do so."
|
||||||
},
|
},
|
||||||
countdownSettings = new FillFlowContainer
|
CountdownSettings = new FillFlowContainer
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.X,
|
RelativeSizeAxes = Axes.X,
|
||||||
AutoSizeAxes = Axes.Y,
|
AutoSizeAxes = Axes.Y,
|
||||||
@ -98,7 +98,7 @@ namespace osu.Game.Screens.Edit.Setup
|
|||||||
letterboxDuringBreaks.Current.BindValueChanged(_ => updateBeatmap());
|
letterboxDuringBreaks.Current.BindValueChanged(_ => updateBeatmap());
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updateCountdownSettingsVisibility() => countdownSettings.FadeTo(EnableCountdown.Current.Value ? 1 : 0);
|
private void updateCountdownSettingsVisibility() => CountdownSettings.FadeTo(EnableCountdown.Current.Value ? 1 : 0);
|
||||||
|
|
||||||
private void onOffsetCommitted()
|
private void onOffsetCommitted()
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user