public async Task WhenHandlingAnything_ThenDelaysTheSpecifiedDuration() { var duration = TimeSpan.FromSeconds(2); var handler = new LongRunningHandler(duration); var context = new ProcessingContext("", "", ""); var body = new byte[] { }; var headers = new Dictionary <string, string>(); await AssertExt.TaskRanForAtLeast(() => handler.ExecuteAsync(context, body, headers), duration); }