NetworkWriterTest: use CreateNetworked

This commit is contained in:
vis2k 2021-05-20 13:30:50 +08:00
parent 4b3061a786
commit 2052d1e7ca

View File

@ -8,7 +8,7 @@
namespace Mirror.Tests namespace Mirror.Tests
{ {
[TestFixture] [TestFixture]
public class NetworkWriterTest public class NetworkWriterTest : MirrorTest
{ {
/* uncomment if needed. commented for faster test workflow. this takes >3s. /* uncomment if needed. commented for faster test workflow. this takes >3s.
[Test] [Test]
@ -1020,14 +1020,10 @@ void WriteBadArray()
[Test] [Test]
public void TestNetworkBehaviour() public void TestNetworkBehaviour()
{ {
//setup CreateNetworked(out GameObject gameObject, out NetworkIdentity identity, out RpcNetworkIdentityBehaviour behaviour);
GameObject gameObject = new GameObject();
NetworkIdentity identity = gameObject.AddComponent<NetworkIdentity>();
RpcNetworkIdentityBehaviour behaviour = gameObject.AddComponent<RpcNetworkIdentityBehaviour>();
const uint netId = 100; const uint netId = 100;
identity.netId = netId; identity.netId = netId;
NetworkIdentity.spawned[netId] = identity; NetworkIdentity.spawned[netId] = identity;
try try