コード例 #1
0
        public async IPandaTask ThrowsOnAwaitResult()
        {
            // arrange
            var excpectException = new Exception();
            async IPandaTask <int> func() => await PandaTasksUtilities.GetTaskWithError <int>(excpectException);

            //act
            Exception realException = null;

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

            //assert
            Assert.That(realException, Is.EqualTo(excpectException));
        }
コード例 #2
0
 private static IPandaTask GetChildOperationCanceledTask() => PandaTasksUtilities.GetTaskWithError(new RandomChildOfOperationCanceledException());