mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 11:00:32 +00:00
tests for ClientScene.UnregisterSpawnHandler (#1816)
This commit is contained in:
parent
28093f9072
commit
66728cdeef
@ -150,6 +150,38 @@ public void UnregisterPrefab_ErrorWhenPrefabHasNoNetworkIdentity()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void UnregisterSpawnHandler_RemovesSpawnHandlersFromDictionary()
|
||||||
|
{
|
||||||
|
spawnHandlers.Add(validPrefabGuid, new SpawnHandlerDelegate(x => null));
|
||||||
|
|
||||||
|
ClientScene.UnregisterSpawnHandler(validPrefabGuid);
|
||||||
|
|
||||||
|
Assert.IsFalse(unspawnHandlers.ContainsKey(validPrefabGuid));
|
||||||
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void UnregisterSpawnHandler_RemovesUnSpawnHandlersFromDictionary()
|
||||||
|
{
|
||||||
|
unspawnHandlers.Add(validPrefabGuid, new UnSpawnDelegate(x => { }));
|
||||||
|
|
||||||
|
ClientScene.UnregisterSpawnHandler(validPrefabGuid);
|
||||||
|
|
||||||
|
Assert.IsFalse(unspawnHandlers.ContainsKey(validPrefabGuid));
|
||||||
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void UnregisterSpawnHandler_DoesNotRemovePrefabDictionary()
|
||||||
|
{
|
||||||
|
prefabs.Add(validPrefabGuid, validPrefab);
|
||||||
|
|
||||||
|
ClientScene.UnregisterSpawnHandler(validPrefabGuid);
|
||||||
|
|
||||||
|
// Should not be removed
|
||||||
|
Assert.IsTrue(prefabs.ContainsKey(validPrefabGuid));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
public void ClearSpawners_RemovesAllPrefabsFromDictionary()
|
public void ClearSpawners_RemovesAllPrefabsFromDictionary()
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user