public IEnumerator GuidPrefabInstance_HasUniqueGuid() { FakeGate instance = GameObject.Instantiate <FakeGate>(guidPrefab); Assert.AreNotEqual(guidBase.GetGuid(), instance.GetGuid()); Assert.AreNotEqual(instance.GetGuid(), guidPrefab.GetGuid()); yield return(null); }
public IEnumerator GateCreation_CreatesNewGuid() { FakeGate guid1 = _fake.Instance; FakeGate guid2 = new TestComponent <FakeGate>().Instance; Assert.AreNotEqual(guid1.GetGuid(), guid2.GetGuid()); yield return(null); }
public IEnumerator GateDuplication_DetectsGuidCollision() { LogAssert.Expect(LogType.Warning, "Guid Collision Detected while creating New Game Object(Clone).\nAssigning new Guid."); FakeGate clone = GameObject.Instantiate <FakeGate>(_fake.Instance); Assert.AreNotEqual(_fake.Instance.GetGuid(), clone.GetGuid()); yield return(null); }
public void Setup() { prefabPath = "Assets/TemporaryTestGuid.prefab"; GameObject newGO = new GameObject("GuidTestGO"); guidBase = newGO.AddComponent <FakeGate>(); prefab = PrefabUtility.SaveAsPrefabAsset(guidBase.gameObject, prefabPath, out bool success); if (!success) { Assert.Fail("Failed to create prefab for testing"); } guidPrefab = prefab.GetComponent <FakeGate>(); Assert.IsNotNull(prefab); Assert.IsNotNull(guidPrefab); }