1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-12 09:37:24 +08:00
osu-lazer/osu.Game/Tests/Visual/OsuTestCase.cs

36 lines
1.1 KiB
C#
Raw Normal View History

2018-04-13 17:19:50 +08:00
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System.IO;
using System.Reflection;
using osu.Framework.Testing;
namespace osu.Game.Tests.Visual
{
public abstract class OsuTestCase : TestCase
{
2018-04-18 14:12:48 +08:00
protected override ITestCaseTestRunner CreateRunner() => new OsuTestCaseTestRunner();
2018-04-13 17:19:50 +08:00
2018-04-18 14:12:48 +08:00
public class OsuTestCaseTestRunner : OsuGameBase, ITestCaseTestRunner
2018-04-13 17:19:50 +08:00
{
protected override string MainResourceFile => File.Exists(base.MainResourceFile) ? base.MainResourceFile : Assembly.GetExecutingAssembly().Location;
2018-04-18 14:12:48 +08:00
private readonly TestCaseTestRunner.TestRunner runner;
public OsuTestCaseTestRunner()
2018-04-13 17:19:50 +08:00
{
2018-04-18 14:12:48 +08:00
runner = new TestCaseTestRunner.TestRunner();
2018-04-13 17:19:50 +08:00
}
protected override void LoadComplete()
{
base.LoadComplete();
2018-04-18 14:12:48 +08:00
Add(runner);
2018-04-13 17:19:50 +08:00
}
2018-04-18 14:12:48 +08:00
public void RunTestBlocking(TestCase test) => runner.RunTestBlocking(test);
2018-04-13 17:19:50 +08:00
}
}
}