mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 02:50:32 +00:00
NetworkServerTest cleanup
This commit is contained in:
parent
ad5eac2016
commit
3debc65ffd
@ -30,6 +30,12 @@ public virtual void TearDown()
|
||||
NetworkClient.Shutdown();
|
||||
NetworkServer.Shutdown();
|
||||
|
||||
// some tests might modify NetworkServer.connections without ever
|
||||
// starting the server.
|
||||
// NetworkServer.Shutdown() only clears connections if it was started.
|
||||
// so let's do it manually for proper test cleanup here.
|
||||
NetworkServer.connections.Clear();
|
||||
|
||||
foreach (GameObject go in instantiated)
|
||||
if (go != null)
|
||||
GameObject.DestroyImmediate(go);
|
||||
|
@ -858,8 +858,6 @@ public void NoExternalConnections_WithConnections()
|
||||
NetworkServer.connections.Add(2, null);
|
||||
Assert.That(NetworkServer.NoExternalConnections(), Is.False);
|
||||
Assert.That(NetworkServer.connections.Count, Is.EqualTo(2));
|
||||
|
||||
NetworkServer.connections.Clear();
|
||||
}
|
||||
|
||||
[Test]
|
||||
@ -873,7 +871,6 @@ public void NoExternalConnections_WithHostOnly()
|
||||
Assert.That(NetworkServer.NoExternalConnections(), Is.True);
|
||||
Assert.That(NetworkServer.connections.Count, Is.EqualTo(1));
|
||||
|
||||
NetworkServer.connections.Clear();
|
||||
NetworkServer.RemoveLocalConnection();
|
||||
}
|
||||
|
||||
@ -889,7 +886,6 @@ public void NoExternalConnections_WithHostAndConnection()
|
||||
Assert.That(NetworkServer.NoExternalConnections(), Is.False);
|
||||
Assert.That(NetworkServer.connections.Count, Is.EqualTo(2));
|
||||
|
||||
NetworkServer.connections.Clear();
|
||||
NetworkServer.RemoveLocalConnection();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user