From 7f36a75ef788a516b77d38bfcf5fc8bea9264e13 Mon Sep 17 00:00:00 2001 From: vis2k Date: Tue, 15 Jun 2021 16:40:58 +0800 Subject: [PATCH] NetworkServerTest: SetClientReadyAndNotReady simplified --- Assets/Mirror/Tests/Editor/NetworkServerTest.cs | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/Assets/Mirror/Tests/Editor/NetworkServerTest.cs b/Assets/Mirror/Tests/Editor/NetworkServerTest.cs index 44825ed67..df575271a 100644 --- a/Assets/Mirror/Tests/Editor/NetworkServerTest.cs +++ b/Assets/Mirror/Tests/Editor/NetworkServerTest.cs @@ -396,15 +396,14 @@ public void OnDataReceivedInvalidConnectionId() [Test] public void SetClientReadyAndNotReady() { - LocalConnectionToClient connection = new LocalConnectionToClient(); - connection.connectionToServer = new LocalConnectionToServer(); - Assert.That(connection.isReady, Is.False); + CreateLocalConnectionPair(out LocalConnectionToClient connectionToClient, out _); + Assert.That(connectionToClient.isReady, Is.False); - NetworkServer.SetClientReady(connection); - Assert.That(connection.isReady, Is.True); + NetworkServer.SetClientReady(connectionToClient); + Assert.That(connectionToClient.isReady, Is.True); - NetworkServer.SetClientNotReady(connection); - Assert.That(connection.isReady, Is.False); + NetworkServer.SetClientNotReady(connectionToClient); + Assert.That(connectionToClient.isReady, Is.False); } [Test]