1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-18 05:12:53 +08:00
osu-lazer/osu.Game.Tests/Visual/TestCaseChangelog.cs

64 lines
2.1 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 releaseStreamCount;
private int index;
2018-07-19 01:32:15 +08:00
private void indexIncrement() => index = index == releaseStreamCount - 1 ? 0 : index + 1;
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-19 01:32:15 +08:00
releaseStreamCount = changelog.Streams.BadgesContainer.Children.Count;
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-19 01:32:15 +08:00
changelog.Streams.BadgesContainer.Children[index].Activate();
2018-07-18 21:17:20 +08:00
indexIncrement();
2018-07-18 07:35:06 +08:00
}, releaseStreamCount);
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-19 01:32:15 +08:00
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();
});
AddWaitStep(4);
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-19 01:32:15 +08:00
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-17 05:50:22 +08:00
}
}
}