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)); }
private static IPandaTask GetChildOperationCanceledTask() => PandaTasksUtilities.GetTaskWithError(new RandomChildOfOperationCanceledException());