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