Esempio n. 1
0
        public void CoroutineService_WaitWhileAsync_ReturnTaskThatCompletesAfterPredicateReturnsTrue()
        {
            var coroutineService = new CoroutineService();

            bool condition = true;

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

            coroutineService.TickCoroutines();

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

            condition = false;

            coroutineService.TickCoroutines();

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