2021-07-01 19:35:31 +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.
|
|
|
|
|
|
|
|
|
|
using NUnit.Framework;
|
|
|
|
|
using osu.Framework.Graphics;
|
|
|
|
|
using osu.Game.Beatmaps;
|
|
|
|
|
using osu.Game.Online.Rooms;
|
|
|
|
|
using osu.Game.Screens.OnlinePlay.Components;
|
|
|
|
|
using osu.Game.Tests.Visual.OnlinePlay;
|
|
|
|
|
|
|
|
|
|
namespace osu.Game.Tests.Visual.Multiplayer
|
|
|
|
|
{
|
|
|
|
|
public partial class TestSceneStarRatingRangeDisplay : OnlinePlayTestScene
|
|
|
|
|
{
|
2022-07-29 14:27:39 +08:00
|
|
|
|
public override void SetUpSteps()
|
2021-07-01 19:35:31 +08:00
|
|
|
|
{
|
2022-07-29 14:27:39 +08:00
|
|
|
|
base.SetUpSteps();
|
2021-07-01 19:35:31 +08:00
|
|
|
|
|
2022-07-29 14:27:39 +08:00
|
|
|
|
AddStep("create display", () =>
|
2021-07-01 19:35:31 +08:00
|
|
|
|
{
|
2022-07-29 14:27:39 +08:00
|
|
|
|
SelectedRoom.Value = new Room();
|
|
|
|
|
|
2024-11-13 21:33:49 +08:00
|
|
|
|
Child = new StarRatingRangeDisplay(SelectedRoom.Value)
|
2022-07-29 14:27:39 +08:00
|
|
|
|
{
|
|
|
|
|
Anchor = Anchor.Centre,
|
|
|
|
|
Origin = Anchor.Centre
|
|
|
|
|
};
|
|
|
|
|
});
|
|
|
|
|
}
|
2021-07-01 19:35:31 +08:00
|
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
|
public void TestRange([Values(0, 2, 3, 4, 6, 7)] double min, [Values(0, 2, 3, 4, 6, 7)] double max)
|
|
|
|
|
{
|
|
|
|
|
AddStep("set playlist", () =>
|
|
|
|
|
{
|
2024-11-21 19:26:44 +08:00
|
|
|
|
SelectedRoom.Value!.Playlist =
|
2024-11-14 16:57:32 +08:00
|
|
|
|
[
|
2022-02-15 22:33:26 +08:00
|
|
|
|
new PlaylistItem(new BeatmapInfo { StarRating = min }),
|
|
|
|
|
new PlaylistItem(new BeatmapInfo { StarRating = max }),
|
2024-11-14 16:57:32 +08:00
|
|
|
|
];
|
2021-07-01 19:35:31 +08:00
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|