diff --git a/Assets/Mirror/Tests/Editor/NetworkServerTest.cs b/Assets/Mirror/Tests/Editor/NetworkServerTest.cs index 9e04b6018..6e4aa974d 100644 --- a/Assets/Mirror/Tests/Editor/NetworkServerTest.cs +++ b/Assets/Mirror/Tests/Editor/NetworkServerTest.cs @@ -762,9 +762,8 @@ public void HideForConnection() Assert.That(NetworkServer.connections.Count, Is.EqualTo(0)); // setup connections - LocalConnectionToClient connectionToClient = new LocalConnectionToClient(); - LocalConnectionToServer connectionToServer = new LocalConnectionToServer(); - connectionToClient.connectionToServer = new LocalConnectionToServer(); + CreateLocalConnectionPair(out LocalConnectionToClient connectionToClient, + out LocalConnectionToServer connectionToServer); // setup NetworkServer/Client connections so messages are handled NetworkClient.connection = connectionToServer; @@ -772,7 +771,6 @@ public void HideForConnection() // required for ShowForConnection connectionToClient.isReady = true; - connectionToClient.connectionToServer = new LocalConnectionToServer(); // set a client handler int called = 0; @@ -946,10 +944,7 @@ public void NoExternalConnectionsTest_WithConnections() [Test] public void NoExternalConnectionsTest_WithHostOnly() { - LocalConnectionToServer connectionToServer = new LocalConnectionToServer(); - LocalConnectionToClient connectionToClient = new LocalConnectionToClient(); - connectionToServer.connectionToClient = connectionToClient; - connectionToClient.connectionToServer = connectionToServer; + CreateLocalConnectionPair(out LocalConnectionToClient connectionToClient, out _); NetworkServer.SetLocalConnection(connectionToClient); NetworkServer.connections.Add(0, connectionToClient);