2020-02-14 19:27:37 +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.
|
|
|
|
|
|
2020-07-09 17:55:10 +08:00
|
|
|
|
using NUnit.Framework;
|
2020-02-14 19:27:37 +08:00
|
|
|
|
using osu.Framework.Graphics;
|
2021-11-04 17:02:44 +08:00
|
|
|
|
using osu.Game.Online.API.Requests.Responses;
|
2021-06-25 12:02:19 +08:00
|
|
|
|
using osu.Game.Online.Rooms;
|
2020-12-25 23:50:00 +08:00
|
|
|
|
using osu.Game.Screens.OnlinePlay.Components;
|
2021-06-24 15:29:06 +08:00
|
|
|
|
using osu.Game.Tests.Visual.OnlinePlay;
|
2020-12-18 14:11:11 +08:00
|
|
|
|
using osu.Game.Users;
|
2020-02-14 19:27:37 +08:00
|
|
|
|
|
2020-12-25 12:20:37 +08:00
|
|
|
|
namespace osu.Game.Tests.Visual.Playlists
|
2020-02-14 19:27:37 +08:00
|
|
|
|
{
|
2021-06-25 12:02:19 +08:00
|
|
|
|
public partial class TestScenePlaylistsParticipantsList : OnlinePlayTestScene
|
2020-02-14 19:27:37 +08:00
|
|
|
|
{
|
2022-07-29 14:27:39 +08:00
|
|
|
|
public override void SetUpSteps()
|
2020-12-18 13:58:58 +08:00
|
|
|
|
{
|
2022-07-29 14:27:39 +08:00
|
|
|
|
base.SetUpSteps();
|
2020-12-18 14:11:11 +08:00
|
|
|
|
|
2022-07-29 14:27:39 +08:00
|
|
|
|
AddStep("create list", () =>
|
2020-12-18 14:11:11 +08:00
|
|
|
|
{
|
2024-11-13 15:28:39 +08:00
|
|
|
|
SelectedRoom.Value = new Room { RoomID = 7 };
|
2022-07-29 14:27:39 +08:00
|
|
|
|
|
|
|
|
|
for (int i = 0; i < 50; i++)
|
2020-12-18 14:11:11 +08:00
|
|
|
|
{
|
2022-07-29 14:27:39 +08:00
|
|
|
|
SelectedRoom.Value.RecentParticipants.Add(new APIUser
|
|
|
|
|
{
|
|
|
|
|
Username = "peppy",
|
|
|
|
|
Statistics = new UserStatistics { GlobalRank = 1234 },
|
|
|
|
|
Id = 2
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
2020-12-18 14:11:11 +08:00
|
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
|
public void TestHorizontalLayout()
|
|
|
|
|
{
|
|
|
|
|
AddStep("create component", () =>
|
|
|
|
|
{
|
2024-11-13 18:45:03 +08:00
|
|
|
|
Child = new ParticipantsDisplay(SelectedRoom.Value, Direction.Horizontal)
|
2020-12-18 14:11:11 +08:00
|
|
|
|
{
|
|
|
|
|
Anchor = Anchor.Centre,
|
|
|
|
|
Origin = Anchor.Centre,
|
|
|
|
|
Width = 0.2f,
|
|
|
|
|
};
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
|
public void TestVerticalLayout()
|
|
|
|
|
{
|
|
|
|
|
AddStep("create component", () =>
|
|
|
|
|
{
|
2024-11-13 18:45:03 +08:00
|
|
|
|
Child = new ParticipantsDisplay(SelectedRoom.Value, Direction.Vertical)
|
2020-12-18 14:11:11 +08:00
|
|
|
|
{
|
|
|
|
|
Anchor = Anchor.Centre,
|
|
|
|
|
Origin = Anchor.Centre,
|
|
|
|
|
Width = 0.2f,
|
|
|
|
|
Height = 0.2f,
|
|
|
|
|
};
|
|
|
|
|
});
|
|
|
|
|
}
|
2020-02-14 19:27:37 +08:00
|
|
|
|
}
|
|
|
|
|
}
|