1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-12 04:40:07 +08:00
osu-lazer/osu.Game.Tests/Visual/TestCaseMultiHeader.cs

44 lines
1.2 KiB
C#
Raw Normal View History

2018-05-16 07:34:14 +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 NUnit.Framework;
using osu.Framework.Graphics;
2018-12-22 13:29:27 +08:00
using osu.Game.Screens;
2018-05-16 07:34:14 +08:00
using osu.Game.Screens.Multi;
namespace osu.Game.Tests.Visual
{
[TestFixture]
public class TestCaseMultiHeader : OsuTestCase
{
public TestCaseMultiHeader()
{
2018-12-22 13:29:27 +08:00
int index = 0;
2018-12-26 19:05:57 +08:00
OsuScreen currentScreen = new TestMultiplayerSubScreen(index);
2018-12-22 13:29:27 +08:00
2018-05-16 07:34:14 +08:00
Children = new Drawable[]
{
2018-12-22 13:29:27 +08:00
currentScreen,
new Header(currentScreen)
2018-05-16 07:34:14 +08:00
};
2018-12-22 13:29:27 +08:00
2018-12-26 19:05:57 +08:00
AddStep("push multi screen", () => currentScreen.Push(currentScreen = new TestMultiplayerSubScreen(++index)));
2018-12-22 13:29:27 +08:00
}
2018-12-26 19:05:57 +08:00
private class TestMultiplayerSubScreen : OsuScreen, IMultiplayerSubScreen
2018-12-22 13:29:27 +08:00
{
private readonly int index;
public string ShortTitle => $"Screen {index}";
2018-12-26 19:05:57 +08:00
public TestMultiplayerSubScreen(int index)
2018-12-22 13:29:27 +08:00
{
this.index = index;
}
public override string ToString() => ShortTitle;
2018-05-16 07:34:14 +08:00
}
}
}