simplify test

This commit is contained in:
vis2k 2021-08-07 13:09:54 +08:00
parent 80dbbc9697
commit 48b430c0ae

View File

@ -50,23 +50,16 @@ public void DoesNotAddActiveObjectsToDictionary()
[Test] [Test]
public void DoesNotAddObjectsWithNoSceneId() public void DoesNotAddObjectsWithNoSceneId()
{ {
NetworkIdentity noId1 = CreateSceneObject(0); NetworkIdentity noId = CreateSceneObject(0);
NetworkIdentity noId2 = CreateSceneObject(0); NetworkIdentity hasId = CreateSceneObject(40);
NetworkIdentity hasId1 = CreateSceneObject(40);
NetworkIdentity hasId2 = CreateSceneObject(41);
noId1.gameObject.SetActive(false); noId.gameObject.SetActive(false);
noId2.gameObject.SetActive(false); hasId.gameObject.SetActive(false);
hasId1.gameObject.SetActive(false);
hasId2.gameObject.SetActive(false);
NetworkClient.PrepareToSpawnSceneObjects(); NetworkClient.PrepareToSpawnSceneObjects();
Assert.IsTrue(NetworkClient.spawnableObjects.ContainsValue(hasId1)); Assert.IsTrue(NetworkClient.spawnableObjects.ContainsValue(hasId));
Assert.IsTrue(NetworkClient.spawnableObjects.ContainsValue(hasId2)); Assert.IsFalse(NetworkClient.spawnableObjects.ContainsValue(noId));
Assert.IsFalse(NetworkClient.spawnableObjects.ContainsValue(noId1));
Assert.IsFalse(NetworkClient.spawnableObjects.ContainsValue(noId2));
} }
[Test] [Test]