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