コード例 #1
0
            public void when_add_by_second_time_should_work()
            {
                Collision_2d manager = new Collision_2d();

                UnityEngine.GameObject player = new UnityEngine.GameObject();
                manager.add(player, "status", false);
                manager.add(player, "status", true);
            }
コード例 #2
0
            public void add_two_obj_should_work()
            {
                Collision_2d manager = new Collision_2d();

                UnityEngine.GameObject player = new UnityEngine.GameObject();
                UnityEngine.GameObject enemy  = new UnityEngine.GameObject();
                manager.add(player, "status", false);
                manager.add(enemy, "status", false);
            }
コード例 #3
0
            public void get_status_in_multiple_obj_case_4_should_be_true()
            {
                Collision_2d manager = new Collision_2d();

                UnityEngine.GameObject player = new UnityEngine.GameObject();
                UnityEngine.GameObject enemy  = new UnityEngine.GameObject();
                manager.add(player, "status", true);
                manager.add(enemy, "status", true);
                bool result = manager.get("status");

                Assert.IsTrue(result);
            }
コード例 #4
0
            public void get_a_obj_and_status_should_return_the_bool_expected()
            {
                Collision_2d manager = new Collision_2d();

                UnityEngine.GameObject player = new UnityEngine.GameObject();
                manager.add(player, "status", false);
                bool result = manager.get(player, "status");

                Assert.IsFalse(result);

                manager.add(player, "status", true);
                result = manager.get(player, "status");
                Assert.IsTrue(result);
            }
コード例 #5
0
            public void when_add_a_new_game_object_should_work()
            {
                Collision_2d manager = new Collision_2d();

                UnityEngine.GameObject player = new UnityEngine.GameObject();
                manager.add(player, "status", false);
            }
コード例 #6
0
            public void remove_twice_the_same_should_be_fine()
            {
                Collision_2d manager = new Collision_2d();

                UnityEngine.GameObject player = new UnityEngine.GameObject();
                manager.add(player, "status", true);
                manager.remove(player);
                manager.remove(player);
            }
コード例 #7
0
            public void get_a_obj_that_is_in_the_manger_should_return_a_dict()
            {
                Collision_2d manager = new Collision_2d();

                UnityEngine.GameObject player = new UnityEngine.GameObject();
                manager.add(player, "status", false);
                var result = manager.get(player);

                Assert.IsNotNull(result);
            }
コード例 #8
0
            public void remove_with_multiple_objects_should_work()
            {
                Collision_2d manager = new Collision_2d();

                UnityEngine.GameObject player = new UnityEngine.GameObject();
                UnityEngine.GameObject enemy  = new UnityEngine.GameObject();
                manager.add(player, "status", true);
                manager.add(enemy, "status", true);
                bool result = manager.get("status");

                Assert.IsTrue(result);

                manager.remove(enemy);
                result = manager.get("status");
                Assert.IsTrue(result);

                manager.remove(player);
                result = manager.get("status");
                Assert.IsFalse(result);
            }
コード例 #9
0
            public void get_obj_and_status_in_multiple_obj_should_work()
            {
                Collision_2d manager = new Collision_2d();

                UnityEngine.GameObject player = new UnityEngine.GameObject();
                UnityEngine.GameObject enemy  = new UnityEngine.GameObject();
                manager.add(player, "status", false);
                manager.add(enemy, "status", true);
                bool result = manager.get(player, "status");

                Assert.IsFalse(result);

                result = manager.get(enemy, "status");
                Assert.IsTrue(result);

                manager.add(player, "status", true);
                result = manager.get(player, "status");
                Assert.IsTrue(result);

                result = manager.get(enemy, "status");
                Assert.IsTrue(result);
            }
コード例 #10
0
            public void when_is_remove_a_obj_the_get_should_be_false()
            {
                Collision_2d manager = new Collision_2d();

                UnityEngine.GameObject player = new UnityEngine.GameObject();
                manager.add(player, "status", true);
                bool result = manager.get("status");

                Assert.IsTrue(result);

                manager.remove(player);
                result = manager.get("status");
                Assert.IsFalse(result);
            }