NetworkServerRuntimeTests: reuse MirrorPlayModeTest

This commit is contained in:
vis2k 2021-05-26 19:37:21 +08:00
parent a911e580e1
commit f94ff22f55

View File

@ -7,29 +7,26 @@
namespace Mirror.Tests.Runtime
{
[TestFixture]
public class NetworkServerRuntimeTest
public class NetworkServerRuntimeTest : MirrorPlayModeTest
{
[UnitySetUp]
public IEnumerator UnitySetUp()
public override IEnumerator UnitySetUp()
{
Transport.activeTransport = new GameObject().AddComponent<MemoryTransport>();
yield return base.UnitySetUp();
// start server and wait 1 frame
NetworkServer.Listen(1);
yield return null;
}
[TearDown]
public void TearDown()
[UnityTearDown]
public override IEnumerator UnityTearDown()
{
if (Transport.activeTransport != null)
{
GameObject.Destroy(Transport.activeTransport.gameObject);
}
if (NetworkServer.active)
{
NetworkServer.Shutdown();
}
yield return base.UnityTearDown();
}
[UnityTest]