From 0d55ed8448a9b525e808b1285905f13ebac4918e Mon Sep 17 00:00:00 2001 From: vis2k Date: Thu, 3 Feb 2022 21:36:48 +0800 Subject: [PATCH] Tests: SetAllClientsNotReady - don't rely on host mode --- Assets/Mirror/Tests/Editor/NetworkServerTest.cs | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/Assets/Mirror/Tests/Editor/NetworkServerTest.cs b/Assets/Mirror/Tests/Editor/NetworkServerTest.cs index 84a6d0827..9d0438861 100644 --- a/Assets/Mirror/Tests/Editor/NetworkServerTest.cs +++ b/Assets/Mirror/Tests/Editor/NetworkServerTest.cs @@ -741,20 +741,13 @@ public void SetClientReadyAndNotReady() [Test] public void SetAllClientsNotReady() { - // add first ready client - CreateLocalConnectionPair(out LocalConnectionToClient first, out _); - first.isReady = true; - NetworkServer.connections[42] = first; - - // add second ready client - CreateLocalConnectionPair(out LocalConnectionToClient second, out _); - second.isReady = true; - NetworkServer.connections[43] = second; + NetworkServer.Listen(1); + ConnectClientBlockingAuthenticatedAndReady(out NetworkConnectionToClient connectionToClient); + Assert.That(connectionToClient.isReady, Is.True); // set all not ready NetworkServer.SetAllClientsNotReady(); - Assert.That(first.isReady, Is.False); - Assert.That(second.isReady, Is.False); + Assert.That(connectionToClient.isReady, Is.False); } [Test]