MirrorTest: TearDown shuts down NetworkClient/Server too

This commit is contained in:
vis2k 2021-06-15 12:42:55 +08:00
parent 3d535e0c4e
commit 7a7ea26cc9
8 changed files with 3 additions and 15 deletions

View File

@ -45,7 +45,6 @@ public void OneTimeSetUp()
[TearDown]
public override void TearDown()
{
NetworkClient.Shutdown();
// reset asset id in case they are changed by tests
validPrefabNetworkIdentity.assetId = validPrefabGuid;

View File

@ -26,6 +26,9 @@ public virtual void SetUp()
public virtual void TearDown()
{
NetworkClient.Shutdown();
NetworkServer.Shutdown();
foreach (GameObject go in instantiated)
if (go != null)
GameObject.DestroyImmediate(go);

View File

@ -29,9 +29,6 @@ public override void SetUp()
public override void TearDown()
{
connectionToServer.Disconnect();
NetworkClient.Shutdown();
NetworkServer.Shutdown();
base.TearDown();
}

View File

@ -195,9 +195,6 @@ public class NetworkBehaviourTests : MirrorEditModeTest
public override void TearDown()
{
NetworkServer.RemoveLocalConnection();
NetworkClient.Shutdown();
NetworkServer.Shutdown();
NetworkIdentity.spawned.Clear();
base.TearDown();
}

View File

@ -16,8 +16,6 @@ public override void SetUp()
[TearDown]
public override void TearDown()
{
NetworkServer.Shutdown();
NetworkClient.Shutdown();
base.TearDown();
}

View File

@ -265,8 +265,6 @@ public void OnDestroy()
public override void TearDown()
{
// cleanup
NetworkClient.Shutdown();
NetworkServer.Shutdown();
NetworkIdentity.spawned.Clear();
base.TearDown();

View File

@ -93,8 +93,6 @@ public override void TearDown()
// reset all state
// shutdown should be called before setting activeTransport to null
NetworkIdentity.spawned.Clear();
NetworkClient.Shutdown();
NetworkServer.Shutdown();
base.TearDown();
}

View File

@ -23,8 +23,6 @@ public override void TearDown()
{
// stop server/client
NetworkClient.Disconnect();
NetworkClient.Shutdown();
NetworkServer.Shutdown();
NetworkIdentity.spawned.Clear();
base.TearDown();
}