2021-07-29 16:53:25 +00:00
|
|
|
// 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 System.IO;
|
|
|
|
using NUnit.Framework;
|
|
|
|
using osu.Framework.Allocation;
|
|
|
|
using osu.Framework.Platform;
|
|
|
|
using osu.Game.Rulesets;
|
|
|
|
using osu.Game.Tests;
|
|
|
|
|
|
|
|
namespace osu.Game.Tournament.Tests.NonVisual
|
|
|
|
{
|
|
|
|
public class DataLoadTest : TournamentHostTest
|
|
|
|
{
|
|
|
|
[Test]
|
|
|
|
public void TestUnavailableRuleset()
|
|
|
|
{
|
2021-12-24 11:17:20 +00:00
|
|
|
using (HeadlessGameHost host = new CleanRunHeadlessGameHost())
|
2021-07-29 16:53:25 +00:00
|
|
|
{
|
|
|
|
try
|
|
|
|
{
|
|
|
|
var osu = new TestTournament();
|
|
|
|
|
|
|
|
LoadTournament(host, osu);
|
|
|
|
var storage = osu.Dependencies.Get<Storage>();
|
|
|
|
|
|
|
|
Assert.That(storage.GetFullPath("."), Is.EqualTo(Path.Combine(host.Storage.GetFullPath("."), "tournaments", "default")));
|
|
|
|
}
|
|
|
|
finally
|
|
|
|
{
|
|
|
|
host.Exit();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public class TestTournament : TournamentGameBase
|
|
|
|
{
|
2022-01-18 03:24:42 +00:00
|
|
|
protected override void LoadComplete()
|
2021-07-29 16:53:25 +00:00
|
|
|
{
|
2022-01-18 03:24:42 +00:00
|
|
|
base.LoadComplete();
|
2021-07-29 16:53:25 +00:00
|
|
|
Ruleset.Value = new RulesetInfo(); // not available
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|