osu/osu.Game.Tests/Visual/Playlists/TestScenePlaylistsParticipa...

64 lines
1.8 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.
using NUnit.Framework;
using osu.Framework.Graphics;
using osu.Game.Screens.OnlinePlay.Components;
2020-12-18 06:11:11 +00:00
using osu.Game.Users;
namespace osu.Game.Tests.Visual.Playlists
{
public class TestScenePlaylistsParticipantsList : OsuTestScene
{
private TestRoomContainer roomContainer;
2020-12-18 05:58:58 +00:00
[SetUp]
public void Setup() => Schedule(() =>
2020-12-18 05:58:58 +00:00
{
Child = roomContainer = new TestRoomContainer
{
Room = { RoomID = { Value = 7 } }
};
2020-12-18 06:11:11 +00:00
for (int i = 0; i < 50; i++)
{
roomContainer.Room.RecentParticipants.Add(new User
2020-12-18 06:11:11 +00:00
{
Username = "peppy",
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", () =>
{
roomContainer.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", () =>
{
roomContainer.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,
};
});
}
}
}