Esempio n. 1
0
    public void Instantiate_WithValidGameObject_ReturnsANewGameObject()
    {
        GameObject go    = new GameObject();
        GameObject newGo = ECSFactory.Instantiate(go);

        Assert.AreNotEqual(go.GetInstanceID(), newGo.GetInstanceID());
    }
Esempio n. 2
0
    public void DestroyImmediate_WithValidGameObject_TriggersOnGameObjectPreDestroyedWithGameObject()
    {
        GameObject go = new GameObject();

        ECSFactory.OnGameObjectPreDestroyed += (eventGo) => {
            Assert.AreEqual(go.GetInstanceID(), eventGo.GetInstanceID());
        };

        ECSFactory.DestroyImmediate(go);
    }
Esempio n. 3
0
    public void Instantiate_WithValidGameObject_TriggersOnGameObjectInstantiatedWithNewGameObject()
    {
        GameObject go = new GameObject();

        ECSFactory.OnGameObjectInstantiated += (eventGo) => {
            Assert.AreNotEqual(go.GetInstanceID(), eventGo.GetInstanceID());
        };

        GameObject newGo = ECSFactory.Instantiate(go);
    }
Esempio n. 4
0
    public void DestroyImmediate_WithValidGameObject_TriggersOnGameObjectPreDestroyed()
    {
        GameObject go             = new GameObject();
        bool       eventTriggered = false;

        ECSFactory.OnGameObjectPreDestroyed += (eventGo) => {
            eventTriggered = true;
        };

        ECSFactory.DestroyImmediate(go);

        Assert.IsTrue(eventTriggered);
    }
Esempio n. 5
0
    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);
    }
Esempio n. 6
0
 public void DestroyImmediate_WithNullGameObject_ThrowsArgumentException()
 {
     Assert.Throws <ArgumentException>(() => { ECSFactory.DestroyImmediate(null); });
 }
Esempio n. 7
0
    public void Instantiate_WithValidGameObject_ReturnsNotNull()
    {
        GameObject go = new GameObject();

        Assert.IsNotNull(ECSFactory.Instantiate(go));
    }
Esempio n. 8
0
 public void Instantiate_WithNullGameObject_ThrowsArgumentException()
 {
     Assert.Throws <ArgumentException>(() => { ECSFactory.Instantiate(null); });
 }