mirror of
https://github.com/osukey/osukey.git
synced 2025-07-01 16:29:58 +09:00
Update to support new framework VisualTests structure
This commit is contained in:
34
osu.Desktop.Tests/Visual/OsuTestCase.cs
Normal file
34
osu.Desktop.Tests/Visual/OsuTestCase.cs
Normal file
@ -0,0 +1,34 @@
|
||||
using NUnit.Framework;
|
||||
using osu.Framework.Desktop.Platform;
|
||||
using osu.Framework.Testing;
|
||||
using osu.Game;
|
||||
|
||||
namespace osu.Desktop.Tests.Visual
|
||||
{
|
||||
[TestFixture]
|
||||
public abstract class OsuTestCase : TestCase
|
||||
{
|
||||
[Test]
|
||||
public override void RunTest()
|
||||
{
|
||||
using (var host = new HeadlessGameHost())
|
||||
host.Run(new OsuTestCaseTestRunner(this));
|
||||
}
|
||||
|
||||
public class OsuTestCaseTestRunner : OsuGameBase
|
||||
{
|
||||
private readonly OsuTestCase testCase;
|
||||
|
||||
public OsuTestCaseTestRunner(OsuTestCase testCase)
|
||||
{
|
||||
this.testCase = testCase;
|
||||
}
|
||||
|
||||
protected override void LoadComplete()
|
||||
{
|
||||
base.LoadComplete();
|
||||
Add(new TestCaseTestRunner.TestRunner(testCase));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user