mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 02:50:32 +00:00
NetworkBehaviourTests: GetSyncVarNetworkIdentityOnClientNull
This commit is contained in:
parent
29035aaa7e
commit
258d3bed02
@ -1366,6 +1366,26 @@ public void GetSyncVarNetworkIdentityOnClient()
|
||||
Transport.activeTransport = null;
|
||||
GameObject.DestroyImmediate(go);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void GetSyncVarNetworkIdentityOnClientNull()
|
||||
{
|
||||
// are we on client and not on server?
|
||||
identity.isClient = true;
|
||||
Assert.That(identity.isServer, Is.False);
|
||||
|
||||
// add test component
|
||||
NetworkBehaviourGetSyncVarNetworkIdentityComponent comp = gameObject.AddComponent<NetworkBehaviourGetSyncVarNetworkIdentityComponent>();
|
||||
comp.syncInterval = 0; // for isDirty check
|
||||
|
||||
// get it on the client. null should be supported.
|
||||
NetworkIdentity result = comp.GetSyncVarNetworkIdentityExposed();
|
||||
Assert.That(result, Is.Null);
|
||||
|
||||
// clean up
|
||||
NetworkServer.Shutdown();
|
||||
Transport.activeTransport = null;
|
||||
}
|
||||
}
|
||||
|
||||
// we need to inherit from networkbehaviour to test protected functions
|
||||
|
Loading…
Reference in New Issue
Block a user