public async Task <bool> Handle(SimpleMessage message) { MessageReceived = message; await Task.Delay(0); TaskHelpers.DelaySendDone(DoneSignal); throw new TestException("ThrowingHandler has thrown"); }
public async Task <bool> Handle(T message) { try { return(await _inner.Handle(message)); } finally { TaskHelpers.DelaySendDone(_doneSignal); } }
private Task ExceptionOnFirstCall() { _sqsCallCounter++; if (_sqsCallCounter == 1) { throw new TestException("testing the failure on first call"); } if (_sqsCallCounter == 2) { TaskHelpers.DelaySendDone(_tcs); } return(Task.FromResult(new ReceiveMessageResponse())); }
public async Task Complete(TMessage message) { try { _messages.Add(message); if (_action != null) { await _action(); } } finally { if (ReceivedMessageCount >= ExpectedMessageCount) { TaskHelpers.DelaySendDone(_doneSignal); } } }
private Task Fail() { TaskHelpers.DelaySendDone(_doneSignal); throw new TestException("Thrown by test ProcessMessage"); }
public Task <bool> Handle(SimpleMessage message) { HandleWasCalled = true; TaskHelpers.DelaySendDone(_doneSignal); return(Task.FromResult(true)); }