mirror of
https://github.com/ppy/osu.git
synced 2025-02-15 15:23:14 +08:00
Add test coverage of startup ruleset being non-default
This commit is contained in:
parent
da9a60a695
commit
8978b88f69
32
osu.Game.Tests/Visual/Navigation/TestSceneStartupRuleset.cs
Normal file
32
osu.Game.Tests/Visual/Navigation/TestSceneStartupRuleset.cs
Normal file
@ -0,0 +1,32 @@
|
||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||
// See the LICENCE file in the repository root for full licence text.
|
||||
|
||||
using NUnit.Framework;
|
||||
using osu.Framework.Development;
|
||||
using osu.Game.Configuration;
|
||||
|
||||
namespace osu.Game.Tests.Visual.Navigation
|
||||
{
|
||||
[TestFixture]
|
||||
public class TestSceneStartupRuleset : OsuGameTestScene
|
||||
{
|
||||
protected override TestOsuGame CreateTestGame()
|
||||
{
|
||||
// Must be done in this function due to the RecycleLocalStorage call just before.
|
||||
var config = DebugUtils.IsDebugBuild
|
||||
? new DevelopmentOsuConfigManager(LocalStorage)
|
||||
: new OsuConfigManager(LocalStorage);
|
||||
|
||||
config.SetValue(OsuSetting.Ruleset, "mania");
|
||||
config.Save();
|
||||
|
||||
return base.CreateTestGame();
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestRulesetConsumed()
|
||||
{
|
||||
AddUntilStep("ruleset correct", () => Game.Ruleset.Value.ShortName == "mania");
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user