mirror of
https://github.com/osukey/osukey.git
synced 2025-05-15 18:47:33 +09:00
Update NewsOverlay visual tests to expose LoadAndShowChild() for testing purposes
This commit is contained in:
parent
88ec0c1486
commit
e7a06aeadc
@ -2,22 +2,28 @@
|
|||||||
// See the LICENCE file in the repository root for full licence text.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
using osu.Game.Overlays;
|
using osu.Game.Overlays;
|
||||||
|
using osu.Game.Overlays.News;
|
||||||
|
|
||||||
namespace osu.Game.Tests.Visual.Online
|
namespace osu.Game.Tests.Visual.Online
|
||||||
{
|
{
|
||||||
public class TestSceneNewsOverlay : OsuTestScene
|
public class TestSceneNewsOverlay : OsuTestScene
|
||||||
{
|
{
|
||||||
private NewsOverlay news;
|
private TestNewsOverlay news;
|
||||||
|
|
||||||
protected override void LoadComplete()
|
protected override void LoadComplete()
|
||||||
{
|
{
|
||||||
base.LoadComplete();
|
base.LoadComplete();
|
||||||
Add(news = new NewsOverlay());
|
Add(news = new TestNewsOverlay());
|
||||||
AddStep(@"Show", news.Show);
|
AddStep(@"Show", news.Show);
|
||||||
AddStep(@"Hide", news.Hide);
|
AddStep(@"Hide", news.Hide);
|
||||||
|
|
||||||
AddStep(@"Show front page", () => news.ShowFrontPage());
|
AddStep(@"Show front page", () => news.ShowFrontPage());
|
||||||
AddStep(@"Custom article", () => news.Current.Value = "Test Article 101");
|
AddStep(@"Custom article", () => news.Current.Value = "Test Article 101");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private class TestNewsOverlay : NewsOverlay
|
||||||
|
{
|
||||||
|
public new void LoadAndShowChild(NewsContent content) => base.LoadAndShowChild(content);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user