Example #1
0
        public async IPandaTask ThrowsOnAwait()
        {
            // arrange
            var excpectException = new Exception();
            async IPandaTask func() => await PandaTasksUtilities.GetTaskWithError(excpectException);

            //act
            Exception realException = null;

            try
            {
                await func();
            }
            catch (Exception ex)
            {
                realException = ex;
            }

            //assert
            Assert.That(realException, Is.EqualTo(excpectException));
        }
Example #2
0
 private IPandaTask NonSynchronousTask()
 {
     return(PandaTasksUtilities.Delay(TimeSpan.FromMilliseconds(100)));
 }
Example #3
0
 public void GetCanceledTask_Should_Return_Same_Instance() =>
 Assert.That(PandaTasksUtilities.GetCanceledTask <T>(), Is.EqualTo(PandaTasksUtilities.GetCanceledTask <T>()));
Example #4
0
 private static IPandaTask GetChildOperationCanceledTask() => PandaTasksUtilities.GetTaskWithError(new RandomChildOfOperationCanceledException());
Example #5
0
 public async Task ReturnSystemTaskFromSystemTaskDelay()
 {
     await PandaTasksUtilities.Delay( 10 );
 }
Example #6
0
 public async Task< int > ReturnSystemTaskValueFromCompletedPandaTask()
 {
     return await PandaTasksUtilities.GetCompletedTask(1);
 }