public IEnumerator add_multiple_tasks()
        {
            Human            human = CreateHuman();
            CommandProcessor cp    = human.AI.CommandProcessor;

            int taskCount = (int)Random.Range(2, 10);

            for (int i = 0; i < taskCount; i++)
            {
                cp.AddTask(new Task());
            }

            for (int i = 0; i <= taskCount; i++)
            {
                yield return(null);
            }

            if (cp.HasTask == true)
            {
                Assert.Fail();
            }

            human.Die();
            Assert.Pass();
        }
        private IEnumerator AddTaskAndWaitUntilFinished(Task task, CommandProcessor cp)
        {
            _taskFinished       = false;
            task.ResultHandler += OnTaskFinish;
            cp.AddTask(task);

            yield return(test_add_task(task, cp));

            while (_taskFinished == false)
            {
                yield return(null);
            }
        }