Exemplo n.º 1
0
        public void CoroutineService_WaitUntilAsync_ReturnTaskThatCompletesAfterPredicateReturnsFalse()
        {
            var coroutineService = new CoroutineService();

            bool condition = false;

            Task task = coroutineService.WaitUntilAsync(() => condition);

            coroutineService.TickCoroutines();

            Assert.IsFalse(task.IsCompleted, "Task completed too early");

            condition = true;

            coroutineService.TickCoroutines();

            Assert.IsTrue(task.IsCompleted, "Task did not complete");
        }