1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-30 15:27:28 +08:00
osu-lazer/osu.Game.Tournament.Tests/Components/TestSceneSongBar.cs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

53 lines
1.7 KiB
C#
Raw Normal View History

2022-02-27 22:31:34 +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
2022-02-27 22:31:34 +08:00
using NUnit.Framework;
2022-02-28 10:59:10 +08:00
using osu.Framework.Allocation;
2022-02-27 22:31:34 +08:00
using osu.Framework.Graphics;
using osu.Game.Beatmaps.Legacy;
using osu.Game.Tests.Visual;
using osu.Game.Tournament.Components;
2022-02-28 10:59:10 +08:00
using osu.Game.Tournament.Models;
2022-02-27 22:31:34 +08:00
namespace osu.Game.Tournament.Tests.Components
{
[TestFixture]
public class TestSceneSongBar : OsuTestScene
{
2022-02-28 10:59:10 +08:00
[Cached]
private readonly LadderInfo ladder = new LadderInfo();
2022-02-27 22:31:34 +08:00
[Test]
public void TestSongBar()
{
SongBar songBar = null;
AddStep("create bar", () => Child = songBar = new SongBar
{
RelativeSizeAxes = Axes.X,
Anchor = Anchor.Centre,
Origin = Anchor.Centre
});
AddUntilStep("wait for loaded", () => songBar.IsLoaded);
AddStep("set beatmap", () =>
{
var beatmap = CreateAPIBeatmap(Ruleset.Value);
beatmap.CircleSize = 3.4f;
beatmap.ApproachRate = 6.8f;
beatmap.OverallDifficulty = 5.5f;
beatmap.StarRating = 4.56f;
beatmap.Length = 123456;
beatmap.BPM = 133;
songBar.Beatmap = new TournamentBeatmap(beatmap);
2022-02-27 22:31:34 +08:00
});
AddStep("set mods to HR", () => songBar.Mods = LegacyMods.HardRock);
AddStep("set mods to DT", () => songBar.Mods = LegacyMods.DoubleTime);
AddStep("unset mods", () => songBar.Mods = LegacyMods.None);
}
}
}