mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 11:00:32 +00:00
NetworkBehaviourTests: SyncVarGameObjectEqualWithoutIdentityComponent
This commit is contained in:
parent
949ce8288c
commit
08f426970a
@ -683,6 +683,22 @@ public void SyncVarGameObjectEqualNull()
|
||||
bool result = emptyBehaviour.SyncVarGameObjectEqual(null, identity.netId);
|
||||
Assert.That(result, Is.False);
|
||||
}
|
||||
|
||||
// NOTE: SyncVarGameObjectEqual should be static later
|
||||
[Test]
|
||||
public void SyncVarGameObjectEqualWithoutIdentityComponent()
|
||||
{
|
||||
// our identity should have a netid for comparing
|
||||
identity.netId = 42;
|
||||
|
||||
// gameobject without networkidentity component should return false
|
||||
GameObject go = new GameObject();
|
||||
bool result = emptyBehaviour.SyncVarGameObjectEqual(go, 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