Ejemplo n.º 1
0
        IEnumerator <object> TaskLongLivedWorkerStepWaiter(int[] buf, int numSteps)
        {
            var waitInstance = new WaitForNextStep();

            for (int i = 0; i < numSteps; i++)
            {
                buf[0] = buf[0] + 1;
                yield return(waitInstance);
            }
        }
Ejemplo n.º 2
0
        public void SchedulableWaitForAllTest()
        {
            var a = TaskYieldValue();
            var b = new WaitForNextStep();
            var c = CrashyTask();

            var f = Scheduler.Start(new WaitForAll(a, b, c));

            Assert.IsFalse(f.Completed);

            Scheduler.Step();

            Assert.IsFalse(f.Completed);

            Scheduler.Step();

            Assert.IsTrue(f.Completed);
            Assert.IsTrue(f.Failed);
            Assert.IsInstanceOf <WaitForAllException>(f.Error);
        }