public void GetGameObjectsTest() { Assert.AreEqual(2, TagCache.GetGameObjectsByTag("Test").Length); GameObject[] ga = TagCache.GetGameObjectsByTag("Test"); Assert.AreEqual(true, ga.Contains(testObjectA)); Assert.AreEqual(true, ga.Contains(testObjectB)); Assert.AreEqual(false, ga.Contains(testObjectC)); Assert.AreSame(testObjectC, TagCache.GetGameObjectsByTag("Dummy")[0]); }
public void DeregisterTest() { Assert.AreEqual(true, TagCache.GetGameObjectsByTag("Test").Contains(testObjectA)); Assert.AreEqual(true, TagCache.GetGameObjectsByTag("Test").Contains(testObjectB)); Assert.AreEqual(2, TagCache.GetGameObjectsByTag("Test").Length); TagCache.DeRegister(testObjectA); TagCache.DeRegister(testObjectB); Assert.AreEqual(new GameObject[] { }, TagCache.GetGameObjectsByTag("Test")); Assert.AreEqual(true, TagCache.GetGameObjectsByTag("Dummy").Contains(testObjectC)); Assert.AreEqual(1, TagCache.GetGameObjectsByTag("Dummy").Length); }
public void RegisterTest() { Assert.AreEqual(true, TagCache.GetGameObjectsByTag("Test").Contains(testObjectA)); Assert.AreEqual(true, TagCache.GetGameObjectsByTag("Test").Contains(testObjectB)); Assert.AreEqual(2, TagCache.GetGameObjectsByTag("Test").Length); }