mirror of
https://github.com/ppy/osu.git
synced 2025-01-22 17:52:57 +08:00
Refactor test a bit
This commit is contained in:
parent
b672d4b936
commit
5214731dc1
@ -44,6 +44,8 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
|||||||
private TestMultiplayer multiplayerScreen;
|
private TestMultiplayer multiplayerScreen;
|
||||||
private TestMultiplayerClient client;
|
private TestMultiplayerClient client;
|
||||||
|
|
||||||
|
private TestRequestHandlingMultiplayerRoomManager roomManager => multiplayerScreen.RoomManager;
|
||||||
|
|
||||||
[Cached(typeof(UserLookupCache))]
|
[Cached(typeof(UserLookupCache))]
|
||||||
private UserLookupCache lookupCache = new TestUserLookupCache();
|
private UserLookupCache lookupCache = new TestUserLookupCache();
|
||||||
|
|
||||||
@ -68,7 +70,7 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
|||||||
|
|
||||||
AddStep("load dependencies", () =>
|
AddStep("load dependencies", () =>
|
||||||
{
|
{
|
||||||
client = new TestMultiplayerClient(multiplayerScreen.RoomManager);
|
client = new TestMultiplayerClient(roomManager);
|
||||||
|
|
||||||
// The screen gets suspended so it stops receiving updates.
|
// The screen gets suspended so it stops receiving updates.
|
||||||
Child = client;
|
Child = client;
|
||||||
@ -134,7 +136,7 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
|||||||
{
|
{
|
||||||
AddStep("create room", () =>
|
AddStep("create room", () =>
|
||||||
{
|
{
|
||||||
multiplayerScreen.RoomManager.AddServerSideRoom(new Room
|
roomManager.AddServerSideRoom(new Room
|
||||||
{
|
{
|
||||||
Name = { Value = "Test Room" },
|
Name = { Value = "Test Room" },
|
||||||
Playlist =
|
Playlist =
|
||||||
@ -164,7 +166,7 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
|||||||
{
|
{
|
||||||
AddStep("create room", () =>
|
AddStep("create room", () =>
|
||||||
{
|
{
|
||||||
multiplayerScreen.RoomManager.AddServerSideRoom(new Room
|
roomManager.AddServerSideRoom(new Room
|
||||||
{
|
{
|
||||||
Name = { Value = "Test Room" },
|
Name = { Value = "Test Room" },
|
||||||
Playlist =
|
Playlist =
|
||||||
@ -213,7 +215,7 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
|||||||
{
|
{
|
||||||
AddStep("create room", () =>
|
AddStep("create room", () =>
|
||||||
{
|
{
|
||||||
multiplayerScreen.RoomManager.AddServerSideRoom(new Room
|
roomManager.AddServerSideRoom(new Room
|
||||||
{
|
{
|
||||||
Name = { Value = "Test Room" },
|
Name = { Value = "Test Room" },
|
||||||
Password = { Value = "password" },
|
Password = { Value = "password" },
|
||||||
|
Loading…
Reference in New Issue
Block a user