1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-30 13:30:05 +08:00
osu-lazer/osu.Game.Tests/Visual/TestCaseChangelog.cs

77 lines
2.6 KiB
C#
Raw Normal View History

2018-07-18 09:26:08 +08:00
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
2018-07-17 05:50:22 +08:00
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using NUnit.Framework;
using osu.Game.Overlays;
namespace osu.Game.Tests.Visual
{
[TestFixture]
public class TestCaseChangelog : OsuTestCase
{
private ChangelogOverlay changelog;
2018-07-18 07:35:06 +08:00
private int index;
2018-07-20 01:07:24 +08:00
private void indexIncrement() => index = index >= changelog.Streams.BadgesContainer.Children.Count - 1 ? 0 : index + 1;
private bool isLoaded => changelog.Streams.BadgesContainer.Children.Count > 0;
2018-07-17 05:50:22 +08:00
protected override void LoadComplete()
{
base.LoadComplete();
Add(changelog = new ChangelogOverlay());
2018-07-18 07:35:06 +08:00
2018-07-17 21:01:53 +08:00
AddStep(@"Show", changelog.Show);
2018-07-18 21:17:20 +08:00
AddRepeatStep(@"Toggle Release Stream", () =>
{
2018-07-20 06:52:50 +08:00
if (isLoaded)
changelog.Streams.BadgesContainer.Children[index].Activate();
2018-07-18 21:17:20 +08:00
indexIncrement();
2018-07-20 01:07:24 +08:00
}, 6);
2018-07-18 21:17:20 +08:00
AddStep(@"Listing", changelog.ActivateListing);
AddStep(@"Hide", changelog.Hide);
2018-07-19 01:32:15 +08:00
AddWaitStep(3);
2018-07-18 21:17:20 +08:00
AddStep(@"Show with Release Stream", () =>
{
2018-07-20 06:52:50 +08:00
if (isLoaded)
changelog.Streams.BadgesContainer.Children[index].Activate();
2018-07-18 21:17:20 +08:00
changelog.Show();
indexIncrement();
});
2018-07-19 01:32:15 +08:00
AddWaitStep(3);
2018-07-18 21:17:20 +08:00
AddStep(@"Hide", changelog.Hide);
2018-07-19 01:32:15 +08:00
AddWaitStep(3);
2018-07-18 21:17:20 +08:00
AddStep(@"Show with listing", () =>
{
changelog.ActivateListing();
changelog.Show();
});
2018-07-20 01:07:24 +08:00
AddWaitStep(3);
2018-07-18 21:17:20 +08:00
AddStep(@"Hide", changelog.Hide);
2018-07-19 01:32:15 +08:00
AddWaitStep(3);
2018-07-18 21:17:20 +08:00
AddStep(@"Activate release", () =>
{
2018-07-20 06:52:50 +08:00
if (isLoaded)
changelog.Streams.BadgesContainer.Children[index].Activate();
2018-07-18 21:17:20 +08:00
indexIncrement();
});
AddStep(@"Show with listing", () =>
{
changelog.ActivateListing();
changelog.Show();
});
2018-07-20 06:52:50 +08:00
AddStep(@"Activate Release", () =>
{
if (isLoaded)
changelog.Streams.BadgesContainer.Children[index].Activate();
});
AddStep(@"Activate Listing", changelog.ActivateListing);
AddStep(@"Activate Release", () =>
{
if (isLoaded)
changelog.Streams.BadgesContainer.Children[index].Activate();
indexIncrement();
});
2018-07-17 05:50:22 +08:00
}
}
}