1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-19 03:52:55 +08:00
osu-lazer/osu.Game.Tests/Visual/Playlists/TestScenePlaylistsParticipantsList.cs

68 lines
1.9 KiB
C#
Raw Normal View History

// 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
using NUnit.Framework;
using osu.Framework.Graphics;
using osu.Game.Online.API.Requests.Responses;
using osu.Game.Online.Rooms;
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;
namespace osu.Game.Tests.Visual.Playlists
{
2022-11-24 13:32:20 +08:00
public partial class TestScenePlaylistsParticipantsList : OnlinePlayTestScene
{
public override void SetUpSteps()
2020-12-18 13:58:58 +08:00
{
base.SetUpSteps();
2020-12-18 14:11:11 +08:00
AddStep("create list", () =>
2020-12-18 14:11:11 +08:00
{
SelectedRoom.Value = new Room { RoomID = { Value = 7 } };
for (int i = 0; i < 50; i++)
2020-12-18 14:11:11 +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", () =>
{
Child = new ParticipantsDisplay(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", () =>
{
Child = new ParticipantsDisplay(Direction.Vertical)
2020-12-18 14:11:11 +08:00
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
Width = 0.2f,
Height = 0.2f,
};
});
}
}
}