1
0
mirror of https://github.com/ppy/osu.git synced 2025-03-28 01:47:33 +08:00

reduce test length and fix the poorly worded description

This commit is contained in:
Albie 2019-12-11 19:55:45 +00:00
parent 6b048a03a6
commit 663405d17d

View File

@ -119,11 +119,7 @@ namespace osu.Game.Tests.Visual.Background
{ {
performFullSetup(); performFullSetup();
createFakeStoryboard(); createFakeStoryboard();
AddStep("Enable Storyboard", () => enableStoryboard();
{
player.ReplacesBackground.Value = true;
player.StoryboardEnabled.Value = true;
});
waitForDim(); waitForDim();
AddAssert("Background is invisible, storyboard is visible", () => songSelect.IsBackgroundInvisible() && player.IsStoryboardVisible); AddAssert("Background is invisible, storyboard is visible", () => songSelect.IsBackgroundInvisible() && player.IsStoryboardVisible);
AddStep("Disable Storyboard", () => AddStep("Disable Storyboard", () =>
@ -149,22 +145,17 @@ namespace osu.Game.Tests.Visual.Background
} }
/// <summary> /// <summary>
/// Ensure <see cref="UserDimContainer"/> is able to disable user-defined display settings. /// Ensure <see cref="UserDimContainer"/> can disable user-defined display settings.
/// </summary> /// </summary>
[Test] [Test]
public void DisableUserDisplaySettingsTest() public void DisableUserDisplaySettingsTest()
{ {
performFullSetup(); performFullSetup();
createFakeStoryboard(); createFakeStoryboard();
AddStep("Enable Storyboard", () => enableStoryboard();
{
player.ReplacesBackground.Value = true;
player.StoryboardEnabled.Value = true;
});
AddStep("Enable user dim", () => player.DimmableStoryboard.EnableUserDim.Value = true); AddStep("Enable user dim", () => player.DimmableStoryboard.EnableUserDim.Value = true);
AddStep("Set dim level to 1", () => songSelect.DimLevel.Value = 1f);
waitForDim(); waitForDim();
AddAssert("Ignore User Settings", () => player.DimmableStoryboard.IgnoreUserSettings.Value = true); AddAssert("Ignore user settings", () => player.DimmableStoryboard.IgnoreUserSettings.Value = true);
waitForDim(); waitForDim();
AddAssert("User dim settings ignored", () => !player.DimmableStoryboard.EnableUserDim.Value && player.DimmableStoryboard.DimLevel == 0); AddAssert("User dim settings ignored", () => !player.DimmableStoryboard.EnableUserDim.Value && player.DimmableStoryboard.DimLevel == 0);
} }
@ -194,11 +185,7 @@ namespace osu.Game.Tests.Visual.Background
{ {
performFullSetup(); performFullSetup();
createFakeStoryboard(); createFakeStoryboard();
AddStep("Enable Storyboard", () => enableStoryboard();
{
player.ReplacesBackground.Value = true;
player.StoryboardEnabled.Value = true;
});
AddStep("Enable user dim", () => player.DimmableStoryboard.EnableUserDim.Value = true); AddStep("Enable user dim", () => player.DimmableStoryboard.EnableUserDim.Value = true);
AddStep("Set dim level to 1", () => songSelect.DimLevel.Value = 1f); AddStep("Set dim level to 1", () => songSelect.DimLevel.Value = 1f);
waitForDim(); waitForDim();
@ -285,6 +272,12 @@ namespace osu.Game.Tests.Visual.Background
}); });
}); });
private void enableStoryboard() => AddStep("Enable Storyboard", () =>
{
player.ReplacesBackground.Value = true;
player.StoryboardEnabled.Value = true;
});
private void performFullSetup(bool allowPause = false) private void performFullSetup(bool allowPause = false)
{ {
setupUserSettings(); setupUserSettings();