Tests: SetAllClientsNotReady - don't rely on host mode

This commit is contained in:
vis2k 2022-02-03 21:36:48 +08:00
parent 924ce2b668
commit 0d55ed8448

View File

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