예제 #1
0
        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);
        }
예제 #2
0
        public IEnumerator GateCreation_CreatesNewGuid()
        {
            FakeGate guid1 = _fake.Instance;
            FakeGate guid2 = new TestComponent <FakeGate>().Instance;

            Assert.AreNotEqual(guid1.GetGuid(), guid2.GetGuid());

            yield return(null);
        }
예제 #3
0
        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);
        }
예제 #4
0
        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);
        }