1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-06 06:17:23 +08:00

Add test scene for thumbnail component

This commit is contained in:
Bartłomiej Dach 2021-10-23 18:05:30 +02:00
parent 4011da033b
commit b44db9f5e5
No known key found for this signature in database
GPG Key ID: BCECCD4FA41F6497

View File

@ -0,0 +1,32 @@
// 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.
using NUnit.Framework;
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Game.Beatmaps.Drawables.Cards;
using osu.Game.Overlays;
using osuTK;
namespace osu.Game.Tests.Visual.Beatmaps
{
public class TestSceneBeatmapCardThumbnail : OsuTestScene
{
[Cached]
private OverlayColourProvider colourProvider = new OverlayColourProvider(OverlayColourScheme.Blue);
[Test]
public void TestThumbnailPreview()
{
BeatmapCardThumbnail thumbnail = null;
AddStep("create thumbnail", () => Child = thumbnail = new BeatmapCardThumbnail(CreateAPIBeatmapSet(Ruleset.Value))
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
Size = new Vector2(200)
});
AddToggleStep("toggle dim", dimmed => thumbnail.Dimmed.Value = dimmed);
}
}
}