Ejemplo n.º 1
0
        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));
        }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
        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);
        }
Ejemplo n.º 4
0
        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));
        }
Ejemplo n.º 5
0
        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);
        }