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