NetworkServerTest: SetClientReadyAndNotReady simplified

This commit is contained in:
vis2k 2021-06-15 16:40:58 +08:00
parent 2506195e42
commit 7f36a75ef7

View File

@ -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]