public void TestCreatingAMapFeatureWithTheSameIdReturnsTrue() { var wrapper = new MapFeatureManagerWrapper("id3"); var mapFeatureManager = wrapper.mapFeatureManager; Assert.IsTrue(mapFeatureManager.Create(wrapper.id, mapFeatureData)); Assert.IsTrue(mapFeatureManager.Create(wrapper.id, mapFeatureData)); }
public void TestCreatingMapFeatureCallsDraw() { var wrapper = new MapFeatureManagerWrapper("id1"); var mapFeatureManager = wrapper.mapFeatureManager; Assert.IsFalse(mapFeatureManager.drawCalled); Assert.IsTrue(mapFeatureManager.Create(wrapper.id, mapFeatureData)); Assert.IsTrue(mapFeatureManager.drawCalled); }
public void TestCreatingMapFeatureAddsGameObject() { var wrapper = new MapFeatureManagerWrapper("id2"); var mapFeatureManager = wrapper.mapFeatureManager; GameObject go = GameObject.Find(wrapper.id); Assert.IsNull(go); Assert.IsTrue(mapFeatureManager.Create(wrapper.id, mapFeatureData)); go = GameObject.Find(wrapper.id); Assert.IsNotNull(go); }
public void TestDeleteDestroysMapFeature() { var wrapper = new MapFeatureManagerWrapper("id3"); var mapFeatureManager = wrapper.mapFeatureManager; Assert.IsTrue(mapFeatureManager.Create(wrapper.id, mapFeatureData)); GameObject gameObject = GameObject.Find(wrapper.id); Assert.IsNotNull(gameObject); Assert.IsTrue(mapFeatureManager.Delete(wrapper.id)); Assert.IsNull(GameObject.Find(wrapper.id)); }
public void TestCreatingMapFeatureAddsComponents() { var wrapper = new MapFeatureManagerWrapper("id3"); var mapFeatureManager = wrapper.mapFeatureManager; Assert.IsTrue(mapFeatureManager.Create(wrapper.id, mapFeatureData)); GameObject go = GameObject.Find(wrapper.id); Assert.IsNotNull(go.GetComponent <IsometricPosition>()); Assert.AreEqual( go.transform.rotation, Quaternion.Euler(0.0f, 0.0f, 0.0f)); IsometricPosition component = go.GetComponent <IsometricPosition>(); Vector2 position = new Vector2(1.0f, 2.0f); Assert.AreEqual(component.Vector(), position); }