diff --git a/Assets/Mirror/Tests/Editor/NetworkServerTest.cs b/Assets/Mirror/Tests/Editor/NetworkServerTest.cs index 5003d0193..3a7d3fdda 100644 --- a/Assets/Mirror/Tests/Editor/NetworkServerTest.cs +++ b/Assets/Mirror/Tests/Editor/NetworkServerTest.cs @@ -620,7 +620,6 @@ public void SendToClientOfPlayer() { // listen NetworkServer.Listen(1); - Assert.That(NetworkServer.connections.Count, Is.EqualTo(0)); // setup connections CreateLocalConnectionPair(out LocalConnectionToClient connectionToClient, @@ -632,19 +631,15 @@ public void SendToClientOfPlayer() // set a client handler int called = 0; - void Handler(TestMessage1 _) => ++called; - NetworkClient.RegisterHandler(Handler, false); + NetworkClient.RegisterHandler(msg => ++called, false); NetworkServer.AddConnection(connectionToClient); - // create a message - TestMessage1 message = new TestMessage1 { IntValue = 1, DoubleValue = 2, StringValue = "3" }; - // create a gameobject and networkidentity CreateNetworked(out GameObject _, out NetworkIdentity identity); identity.connectionToClient = connectionToClient; // send it to that player - identity.connectionToClient.Send(message); + identity.connectionToClient.Send(new TestMessage1()); // update local connection once so that the incoming queue is processed connectionToClient.connectionToServer.Update();