public async Task Wait_for_any_signal_with_timeout_and_continue_with_timeout() { var @event = new AutoResetEvent(false); var timeout = TimeSpan.FromSeconds(2); var workflow = new ExpenseAnySignalWorkflowWithTimeout(@event, timeout); string result = null; workflow.Failed += (s, e) => { result = e.Reason; @event.Set(); }; _workflowHost = await HostAsync(workflow); var workflowId = await _domain.StartWorkflow <ExpenseAnySignalWorkflowWithTimeout>("input", _taskListName, _configuration["LambdaRole"]); @event.WaitOne(); @event.WaitOne(timeout.Add(TimeSpan.FromSeconds(3))); Assert.That(result, Is.EqualTo("Signal_timedout")); }
public async Task Wait_for_any_signal_with_timeout_and_continue_with_approved_signal() { var @event = new AutoResetEvent(false); var workflow = new ExpenseAnySignalWorkflowWithTimeout(@event, TimeSpan.FromSeconds(2)); string result = null; workflow.Completed += (s, e) => { result = e.Result; @event.Set(); }; _workflowHost = await HostAsync(workflow); var workflowId = await _domain.StartWorkflow <ExpenseAnySignalWorkflowWithTimeout>("input", _taskListName, _configuration["LambdaRole"]); @event.WaitOne(); await _domain.SendSignal(workflowId, "Approved", ""); @event.WaitOne(); Assert.That(result, Is.EqualTo("\"AccountDone\"")); }