Пример #1
0
        public IEnumerator ContinueWhenAll()
        {
            var startTime = System.DateTime.Now;
            var op        = new ContinueLitTaskOperation(LitTask.WhenAll(new LitTask[] {
                Delay(100),
                Delay(1000),
            }));

            yield return(op);

            Assert.Greater(DateTime.Now, startTime + TimeSpan.FromMilliseconds(1000));
        }
Пример #2
0
        public IEnumerator ContinueWhenAllWithException()
        {
            System.DateTime start = System.DateTime.Now;
            var             op    = new ContinueLitTaskOperation(LitTask.WhenAll(new LitTask[] {
                Delay(100),
                ThrowExceptionAfterAsync(10),
            }));

            yield return(op);

            Assert.NotNull(op.exception);
            Assert.True(op.exception is AggregateException);
            Assert.True((op.exception as AggregateException).InnerException is TestException);
            Assert.GreaterOrEqual(DateTime.Now, start + TimeSpan.FromMilliseconds(100));
        }