2020-02-19 16:47:59 +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 System;
|
|
|
|
using NUnit.Framework;
|
|
|
|
using osu.Framework.Graphics;
|
2021-06-25 12:02:19 +08:00
|
|
|
using osu.Game.Online.Rooms;
|
2020-12-25 12:38:11 +08:00
|
|
|
using osu.Game.Online.Rooms.RoomStatuses;
|
2020-12-25 23:50:00 +08:00
|
|
|
using osu.Game.Screens.OnlinePlay.Lounge.Components;
|
2021-06-24 15:29:06 +08:00
|
|
|
using osu.Game.Tests.Visual.OnlinePlay;
|
2020-02-19 16:47:59 +08:00
|
|
|
using osu.Game.Users;
|
|
|
|
|
|
|
|
namespace osu.Game.Tests.Visual.Multiplayer
|
|
|
|
{
|
2021-06-25 12:02:19 +08:00
|
|
|
public class TestSceneLoungeRoomInfo : OnlinePlayTestScene
|
2020-02-19 16:47:59 +08:00
|
|
|
{
|
|
|
|
[SetUp]
|
2021-06-25 12:02:19 +08:00
|
|
|
public new void Setup() => Schedule(() =>
|
2020-02-19 16:47:59 +08:00
|
|
|
{
|
2021-06-25 12:02:19 +08:00
|
|
|
SelectedRoom.Value = new Room();
|
|
|
|
|
|
|
|
Child = new RoomInfo
|
2020-02-19 16:47:59 +08:00
|
|
|
{
|
2021-06-25 12:02:19 +08:00
|
|
|
Anchor = Anchor.Centre,
|
|
|
|
Origin = Anchor.Centre,
|
|
|
|
Width = 500
|
2020-02-19 16:47:59 +08:00
|
|
|
};
|
|
|
|
});
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
public void TestNonSelectedRoom()
|
|
|
|
{
|
2021-06-25 12:02:19 +08:00
|
|
|
AddStep("set null room", () => SelectedRoom.Value.RoomID.Value = null);
|
2020-02-19 16:47:59 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
public void TestOpenRoom()
|
|
|
|
{
|
|
|
|
AddStep("set open room", () =>
|
|
|
|
{
|
2021-06-25 12:02:19 +08:00
|
|
|
SelectedRoom.Value.RoomID.Value = 0;
|
|
|
|
SelectedRoom.Value.Name.Value = "Room 0";
|
|
|
|
SelectedRoom.Value.Host.Value = new User { Username = "peppy", Id = 2 };
|
|
|
|
SelectedRoom.Value.EndDate.Value = DateTimeOffset.Now.AddMonths(1);
|
|
|
|
SelectedRoom.Value.Status.Value = new RoomStatusOpen();
|
2020-02-19 16:47:59 +08:00
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|