public void Instantiate_WithValidGameObject_ReturnsANewGameObject() { GameObject go = new GameObject(); GameObject newGo = ECSFactory.Instantiate(go); Assert.AreNotEqual(go.GetInstanceID(), newGo.GetInstanceID()); }
public void DestroyImmediate_WithValidGameObject_TriggersOnGameObjectPreDestroyedWithGameObject() { GameObject go = new GameObject(); ECSFactory.OnGameObjectPreDestroyed += (eventGo) => { Assert.AreEqual(go.GetInstanceID(), eventGo.GetInstanceID()); }; ECSFactory.DestroyImmediate(go); }
public void Instantiate_WithValidGameObject_TriggersOnGameObjectInstantiatedWithNewGameObject() { GameObject go = new GameObject(); ECSFactory.OnGameObjectInstantiated += (eventGo) => { Assert.AreNotEqual(go.GetInstanceID(), eventGo.GetInstanceID()); }; GameObject newGo = ECSFactory.Instantiate(go); }
public void DestroyImmediate_WithValidGameObject_TriggersOnGameObjectPreDestroyed() { GameObject go = new GameObject(); bool eventTriggered = false; ECSFactory.OnGameObjectPreDestroyed += (eventGo) => { eventTriggered = true; }; ECSFactory.DestroyImmediate(go); Assert.IsTrue(eventTriggered); }
public void Instantiate_WithValidGameObject_TriggersOnGameObjectInstantiated() { GameObject go = new GameObject(); bool eventTriggered = false; ECSFactory.OnGameObjectInstantiated += (eventGo) => { eventTriggered = true; }; GameObject newGo = ECSFactory.Instantiate(go); Assert.IsTrue(eventTriggered); }
public void DestroyImmediate_WithNullGameObject_ThrowsArgumentException() { Assert.Throws <ArgumentException>(() => { ECSFactory.DestroyImmediate(null); }); }
public void Instantiate_WithValidGameObject_ReturnsNotNull() { GameObject go = new GameObject(); Assert.IsNotNull(ECSFactory.Instantiate(go)); }
public void Instantiate_WithNullGameObject_ThrowsArgumentException() { Assert.Throws <ArgumentException>(() => { ECSFactory.Instantiate(null); }); }