1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-28 02:02:53 +08:00

Create room by clicking button

This commit is contained in:
smoogipoo 2021-10-28 15:41:59 +09:00
parent b0b27a47d5
commit e2c08fb2e5

View File

@ -54,7 +54,6 @@ namespace osu.Game.Tests.Visual.Playlists
{
setupAndCreateRoom(room =>
{
room.RoomID.Value = 1; // forces room creation.
room.Name.Value = "my awesome room";
room.Host.Value = API.LocalUser.Value;
room.RecentParticipants.Add(room.Host.Value);
@ -84,13 +83,6 @@ namespace osu.Game.Tests.Visual.Playlists
});
});
AddStep("move mouse to create button", () =>
{
InputManager.MoveMouseTo(this.ChildrenOfType<PlaylistsRoomSettingsOverlay.CreateRoomButton>().Single());
});
AddStep("click", () => InputManager.Click(MouseButton.Left));
AddAssert("first playlist item selected", () => match.SelectedItem.Value == SelectedRoom.Value.Playlist[0]);
}
@ -143,13 +135,12 @@ namespace osu.Game.Tests.Visual.Playlists
private void setupAndCreateRoom(Action<Room> room)
{
AddStep("setup room", () =>
{
room(SelectedRoom.Value);
AddStep("setup room", () => room(SelectedRoom.Value));
// if this isn't done the test will crash when a poll kicks in.
// probably not correct, but works for now.
OnlinePlayDependencies.RoomManager.CreateRoom(SelectedRoom.Value);
AddStep("click create button", () =>
{
InputManager.MoveMouseTo(this.ChildrenOfType<PlaylistsRoomSettingsOverlay.CreateRoomButton>().Single());
InputManager.Click(MouseButton.Left);
});
}