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

Add disable trigger to a testcase

This commit is contained in:
Andrei Zavatski 2019-07-02 13:22:38 +03:00
parent 08dfe413c1
commit 2971bd8cbc
2 changed files with 16 additions and 26 deletions

View File

@ -3,10 +3,8 @@
using System.Collections.Generic; using System.Collections.Generic;
using NUnit.Framework; using NUnit.Framework;
using osu.Framework.Allocation;
using osu.Game.Beatmaps; using osu.Game.Beatmaps;
using osu.Game.Overlays; using osu.Game.Overlays;
using osu.Game.Rulesets;
namespace osu.Game.Tests.Visual.Online namespace osu.Game.Tests.Visual.Online
{ {
@ -14,7 +12,6 @@ namespace osu.Game.Tests.Visual.Online
public class TestSceneDirectOverlay : OsuTestScene public class TestSceneDirectOverlay : OsuTestScene
{ {
private DirectOverlay direct; private DirectOverlay direct;
private RulesetStore rulesets;
protected override void LoadComplete() protected override void LoadComplete()
{ {
@ -25,18 +22,11 @@ namespace osu.Game.Tests.Visual.Online
AddStep(@"toggle", direct.ToggleVisibility); AddStep(@"toggle", direct.ToggleVisibility);
AddStep(@"result counts", () => direct.ResultAmounts = new DirectOverlay.ResultCounts(1, 4, 13)); AddStep(@"result counts", () => direct.ResultAmounts = new DirectOverlay.ResultCounts(1, 4, 13));
} AddStep(@"trigger disabled", () => Ruleset.Disabled = !Ruleset.Disabled);
[BackgroundDependencyLoader]
private void load(RulesetStore rulesets)
{
this.rulesets = rulesets;
} }
private void newBeatmaps() private void newBeatmaps()
{ {
var ruleset = rulesets.GetRuleset(0);
direct.BeatmapSets = new[] direct.BeatmapSets = new[]
{ {
new BeatmapSetInfo new BeatmapSetInfo
@ -65,7 +55,7 @@ namespace osu.Game.Tests.Visual.Online
{ {
new BeatmapInfo new BeatmapInfo
{ {
Ruleset = ruleset, Ruleset = Ruleset.Value,
StarDifficulty = 5.35f, StarDifficulty = 5.35f,
Metadata = new BeatmapMetadata(), Metadata = new BeatmapMetadata(),
}, },
@ -97,7 +87,7 @@ namespace osu.Game.Tests.Visual.Online
{ {
new BeatmapInfo new BeatmapInfo
{ {
Ruleset = ruleset, Ruleset = Ruleset.Value,
StarDifficulty = 5.81f, StarDifficulty = 5.81f,
Metadata = new BeatmapMetadata(), Metadata = new BeatmapMetadata(),
}, },
@ -129,23 +119,23 @@ namespace osu.Game.Tests.Visual.Online
{ {
new BeatmapInfo new BeatmapInfo
{ {
Ruleset = ruleset, Ruleset = Ruleset.Value,
StarDifficulty = 0.9f, StarDifficulty = 0.9f,
Metadata = new BeatmapMetadata(), Metadata = new BeatmapMetadata(),
}, },
new BeatmapInfo new BeatmapInfo
{ {
Ruleset = ruleset, Ruleset = Ruleset.Value,
StarDifficulty = 1.1f, StarDifficulty = 1.1f,
}, },
new BeatmapInfo new BeatmapInfo
{ {
Ruleset = ruleset, Ruleset = Ruleset.Value,
StarDifficulty = 2.02f, StarDifficulty = 2.02f,
}, },
new BeatmapInfo new BeatmapInfo
{ {
Ruleset = ruleset, Ruleset = Ruleset.Value,
StarDifficulty = 3.49f, StarDifficulty = 3.49f,
}, },
}, },
@ -176,43 +166,43 @@ namespace osu.Game.Tests.Visual.Online
{ {
new BeatmapInfo new BeatmapInfo
{ {
Ruleset = ruleset, Ruleset = Ruleset.Value,
StarDifficulty = 1.26f, StarDifficulty = 1.26f,
Metadata = new BeatmapMetadata(), Metadata = new BeatmapMetadata(),
}, },
new BeatmapInfo new BeatmapInfo
{ {
Ruleset = ruleset, Ruleset = Ruleset.Value,
StarDifficulty = 2.01f, StarDifficulty = 2.01f,
}, },
new BeatmapInfo new BeatmapInfo
{ {
Ruleset = ruleset, Ruleset = Ruleset.Value,
StarDifficulty = 2.87f, StarDifficulty = 2.87f,
}, },
new BeatmapInfo new BeatmapInfo
{ {
Ruleset = ruleset, Ruleset = Ruleset.Value,
StarDifficulty = 3.76f, StarDifficulty = 3.76f,
}, },
new BeatmapInfo new BeatmapInfo
{ {
Ruleset = ruleset, Ruleset = Ruleset.Value,
StarDifficulty = 3.93f, StarDifficulty = 3.93f,
}, },
new BeatmapInfo new BeatmapInfo
{ {
Ruleset = ruleset, Ruleset = Ruleset.Value,
StarDifficulty = 4.37f, StarDifficulty = 4.37f,
}, },
new BeatmapInfo new BeatmapInfo
{ {
Ruleset = ruleset, Ruleset = Ruleset.Value,
StarDifficulty = 5.13f, StarDifficulty = 5.13f,
}, },
new BeatmapInfo new BeatmapInfo
{ {
Ruleset = ruleset, Ruleset = Ruleset.Value,
StarDifficulty = 5.42f, StarDifficulty = 5.42f,
}, },
}, },

View File

@ -43,7 +43,7 @@ namespace osu.Game.Overlays.Direct
private readonly SpriteIcon icon; private readonly SpriteIcon icon;
public DirectRulesetTabItem(RulesetInfo value) public DirectRulesetTabItem(RulesetInfo value)
: base(value) : base(value)
{ {
AutoSizeAxes = Axes.Both; AutoSizeAxes = Axes.Both;