1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-30 07:52:56 +08:00
osu-lazer/osu.Game.Rulesets.Mania.Tests/TestScenePlayfieldCoveringContainer.cs

59 lines
2.0 KiB
C#
Raw Normal View History

2020-07-16 16:35:02 +08:00
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
2022-06-17 15:37:17 +08:00
#nullable disable
2020-07-16 16:35:02 +08:00
using NUnit.Framework;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Shapes;
using osu.Game.Rulesets.Mania.UI;
using osu.Game.Rulesets.UI.Scrolling;
using osu.Game.Tests.Visual;
using osuTK;
using osuTK.Graphics;
namespace osu.Game.Rulesets.Mania.Tests
{
2022-11-24 13:32:20 +08:00
public partial class TestScenePlayfieldCoveringContainer : OsuTestScene
2020-07-16 16:35:02 +08:00
{
private readonly ScrollingTestContainer scrollingContainer;
2020-07-16 20:18:24 +08:00
private readonly PlayfieldCoveringWrapper cover;
2020-07-16 16:35:02 +08:00
public TestScenePlayfieldCoveringContainer()
{
Child = scrollingContainer = new ScrollingTestContainer(ScrollingDirection.Down)
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
Size = new Vector2(300, 500),
2020-07-16 20:18:24 +08:00
Child = cover = new PlayfieldCoveringWrapper(new Box
2020-07-16 20:17:51 +08:00
{
RelativeSizeAxes = Axes.Both,
Colour = Color4.Orange
})
2020-07-16 16:35:02 +08:00
{
RelativeSizeAxes = Axes.Both,
}
};
}
[Test]
public void TestScrollingDownwards()
{
AddStep("set down scroll", () => scrollingContainer.Direction = ScrollingDirection.Down);
AddStep("set coverage = 0.5", () => cover.Coverage = 0.5f);
AddStep("set coverage = 0.8f", () => cover.Coverage = 0.8f);
AddStep("set coverage = 0.2f", () => cover.Coverage = 0.2f);
}
[Test]
public void TestScrollingUpwards()
{
AddStep("set up scroll", () => scrollingContainer.Direction = ScrollingDirection.Up);
AddStep("set coverage = 0.5", () => cover.Coverage = 0.5f);
AddStep("set coverage = 0.8f", () => cover.Coverage = 0.8f);
AddStep("set coverage = 0.2f", () => cover.Coverage = 0.2f);
}
}
}