mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 11:00:32 +00:00
NetworkBehaviourTests: SyncVarNetworkIdentityEqualValidIdentityWithDifferentNetId
This commit is contained in:
parent
c9a3a0dceb
commit
1408e8de42
@ -823,6 +823,24 @@ public void SyncVarNetworkIdentityEqualNull()
|
||||
bool result = emptyBehaviour.SyncVarNetworkIdentityEqual(null, identity.netId);
|
||||
Assert.That(result, Is.False);
|
||||
}
|
||||
|
||||
// NOTE: SyncVarNetworkIdentityEqual should be static later
|
||||
[Test]
|
||||
public void SyncVarNetworkIdentityEqualValidIdentityWithDifferentNetId()
|
||||
{
|
||||
// our identity should have a netid for comparing
|
||||
identity.netId = 42;
|
||||
|
||||
// gameobject with valid networkidentity and netid that is different
|
||||
GameObject go = new GameObject();
|
||||
NetworkIdentity ni = go.AddComponent<NetworkIdentity>();
|
||||
ni.netId = 43;
|
||||
bool result = emptyBehaviour.SyncVarNetworkIdentityEqual(ni, identity.netId);
|
||||
Assert.That(result, Is.False);
|
||||
|
||||
// clean up
|
||||
GameObject.DestroyImmediate(go);
|
||||
}
|
||||
}
|
||||
|
||||
// we need to inherit from networkbehaviour to test protected functions
|
||||
|
Loading…
Reference in New Issue
Block a user