mirror of
https://github.com/ppy/osu
synced 2025-01-02 04:12:13 +00:00
Fix failing tests
This commit is contained in:
parent
4bcc05a7fc
commit
018dcc98b4
@ -65,17 +65,19 @@ namespace osu.Game.Tests.Visual
|
||||
|
||||
foreach (var rulesetInfo in rulesets.AvailableRulesets)
|
||||
{
|
||||
var ruleset = rulesetInfo.CreateInstance();
|
||||
var instance = rulesetInfo.CreateInstance();
|
||||
var testBeatmap = createTestBeatmap(rulesetInfo);
|
||||
|
||||
beatmaps.Add(testBeatmap);
|
||||
|
||||
AddStep("set ruleset", () => Ruleset.Value = rulesetInfo);
|
||||
|
||||
selectBeatmap(testBeatmap);
|
||||
|
||||
testBeatmapLabels(ruleset);
|
||||
testBeatmapLabels(instance);
|
||||
|
||||
// TODO: adjust cases once more info is shown for other gamemodes
|
||||
switch (ruleset)
|
||||
switch (instance)
|
||||
{
|
||||
case OsuRuleset _:
|
||||
testInfoLabels(5);
|
||||
|
@ -16,7 +16,7 @@ namespace osu.Game.Tests.Visual
|
||||
private readonly OsuTestBeatmap beatmap = new OsuTestBeatmap(new DummyWorkingBeatmap());
|
||||
protected BindableBeatmap Beatmap => beatmap;
|
||||
|
||||
private readonly Bindable<RulesetInfo> ruleset = new Bindable<RulesetInfo>();
|
||||
protected readonly Bindable<RulesetInfo> Ruleset = new Bindable<RulesetInfo>();
|
||||
|
||||
protected DependencyContainer Dependencies { get; private set; }
|
||||
|
||||
@ -27,7 +27,7 @@ namespace osu.Game.Tests.Visual
|
||||
Dependencies.CacheAs<BindableBeatmap>(beatmap);
|
||||
Dependencies.CacheAs<IBindableBeatmap>(beatmap);
|
||||
|
||||
Dependencies.CacheAs(ruleset);
|
||||
Dependencies.CacheAs(Ruleset);
|
||||
|
||||
return Dependencies;
|
||||
}
|
||||
@ -37,7 +37,7 @@ namespace osu.Game.Tests.Visual
|
||||
{
|
||||
beatmap.SetAudioManager(audioManager);
|
||||
|
||||
ruleset.Value = rulesets.AvailableRulesets.First();
|
||||
Ruleset.Value = rulesets.AvailableRulesets.First();
|
||||
}
|
||||
|
||||
protected override void Dispose(bool isDisposing)
|
||||
|
@ -86,7 +86,11 @@ namespace osu.Game.Tests.Visual
|
||||
private readonly WeakList<WorkingBeatmap> workingWeakReferences = new WeakList<WorkingBeatmap>();
|
||||
private readonly WeakList<Player> playerWeakReferences = new WeakList<Player>();
|
||||
|
||||
private Player loadPlayerFor(RulesetInfo ri) => loadPlayerFor(ri.CreateInstance());
|
||||
private Player loadPlayerFor(RulesetInfo ri)
|
||||
{
|
||||
Ruleset.Value = ri;
|
||||
return loadPlayerFor(ri.CreateInstance());
|
||||
}
|
||||
|
||||
private Player loadPlayerFor(Ruleset r)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user