mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 02:50:32 +00:00
fix PrepareToSpawnSceneObjects tests after recent fix
This commit is contained in:
parent
a463d48681
commit
d64c5fb61b
@ -31,8 +31,9 @@ public void AddsAllInactiveIdentitiesInSceneWithSceneIdToDictionary()
|
||||
Assert.IsTrue(NetworkClient.spawnableObjects.ContainsValue(obj2));
|
||||
}
|
||||
|
||||
// test for https://github.com/MirrorNetworking/Mirror/issues/3541
|
||||
[Test]
|
||||
public void DoesNotAddActiveObjectsToDictionary()
|
||||
public void DoesAddActiveAndInactiveObjectsToDictionary()
|
||||
{
|
||||
NetworkIdentity active = CreateSceneObject(30);
|
||||
NetworkIdentity inactive = CreateSceneObject(32);
|
||||
@ -42,9 +43,9 @@ public void DoesNotAddActiveObjectsToDictionary()
|
||||
|
||||
NetworkClient.PrepareToSpawnSceneObjects();
|
||||
|
||||
Assert.That(NetworkClient.spawnableObjects, Has.Count.EqualTo(1));
|
||||
Assert.That(NetworkClient.spawnableObjects, Has.Count.EqualTo(2));
|
||||
Assert.IsTrue(NetworkClient.spawnableObjects.ContainsValue(inactive));
|
||||
Assert.IsFalse(NetworkClient.spawnableObjects.ContainsValue(active));
|
||||
Assert.IsTrue(NetworkClient.spawnableObjects.ContainsValue(active));
|
||||
}
|
||||
|
||||
[Test]
|
||||
@ -90,13 +91,13 @@ public void ClearsExistingItemsFromDictionary()
|
||||
NetworkIdentity obj1 = CreateSceneObject(61);
|
||||
NetworkClient.spawnableObjects.Add(61, obj1);
|
||||
|
||||
// new disabled object
|
||||
// new disabled object - should be included too since netId == 0.
|
||||
NetworkIdentity obj2 = CreateSceneObject(63);
|
||||
obj2.gameObject.SetActive(false);
|
||||
|
||||
NetworkClient.PrepareToSpawnSceneObjects();
|
||||
|
||||
Assert.That(NetworkClient.spawnableObjects, Has.Count.EqualTo(1));
|
||||
Assert.That(NetworkClient.spawnableObjects, Has.Count.EqualTo(2));
|
||||
Assert.IsFalse(NetworkClient.spawnableObjects.ContainsValue(null));
|
||||
Assert.IsTrue(NetworkClient.spawnableObjects.ContainsValue(obj2));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user