From d80a5d44eedca57e8be969d771152edb4fe4b229 Mon Sep 17 00:00:00 2001 From: smallketchup82 <69545310+smallketchup82@users.noreply.github.com> Date: Thu, 18 Jan 2024 03:17:37 -0500 Subject: [PATCH] Add tests for DifficultyIcon --- .../Beatmaps/TestSceneDifficultyIcon.cs | 42 +++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 osu.Game.Tests/Visual/Beatmaps/TestSceneDifficultyIcon.cs diff --git a/osu.Game.Tests/Visual/Beatmaps/TestSceneDifficultyIcon.cs b/osu.Game.Tests/Visual/Beatmaps/TestSceneDifficultyIcon.cs new file mode 100644 index 0000000000..aa2543eea1 --- /dev/null +++ b/osu.Game.Tests/Visual/Beatmaps/TestSceneDifficultyIcon.cs @@ -0,0 +1,42 @@ +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. + +#nullable disable + +using NUnit.Framework; +using osu.Framework.Allocation; +using osu.Framework.Audio; +using osu.Framework.Platform; +using osu.Game.Beatmaps.Drawables; +using osu.Game.Rulesets; +using osu.Game.Rulesets.Osu; +using osu.Game.Tests.Beatmaps; + +namespace osu.Game.Tests.Visual.Beatmaps +{ + public partial class TestSceneDifficultyIcon : OsuTestScene + { + [Test] + public void createDifficultyIcon() + { + DifficultyIcon difficultyIcon = null; + + AddStep("create difficulty icon", () => + { + Child = difficultyIcon = new DifficultyIcon(new TestBeatmap(new OsuRuleset().RulesetInfo).BeatmapInfo, new OsuRuleset().RulesetInfo) + { + ShowTooltip = true, + ShowExtendedTooltip = true + }; + }); + + AddStep("hide extended tooltip", () => difficultyIcon.ShowExtendedTooltip = false); + + AddStep("hide tooltip", () => difficultyIcon.ShowTooltip = false); + + AddStep("show tooltip", () => difficultyIcon.ShowTooltip = true); + + AddStep("show extended tooltip", () => difficultyIcon.ShowExtendedTooltip = true); + } + } +}