コード例 #1
0
        public async Task <bool> Handle(SimpleMessage message)
        {
            MessageReceived = message;

            await Task.Delay(0);

            TaskHelpers.DelaySendDone(DoneSignal);

            throw new TestException("ThrowingHandler has thrown");
        }
コード例 #2
0
 public async Task <bool> Handle(T message)
 {
     try
     {
         return(await _inner.Handle(message));
     }
     finally
     {
         TaskHelpers.DelaySendDone(_doneSignal);
     }
 }
コード例 #3
0
        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()));
        }
コード例 #4
0
        public async Task Complete(TMessage message)
        {
            try
            {
                _messages.Add(message);

                if (_action != null)
                {
                    await _action();
                }
            }
            finally
            {
                if (ReceivedMessageCount >= ExpectedMessageCount)
                {
                    TaskHelpers.DelaySendDone(_doneSignal);
                }
            }
        }
コード例 #5
0
 private Task Fail()
 {
     TaskHelpers.DelaySendDone(_doneSignal);
     throw new TestException("Thrown by test ProcessMessage");
 }
コード例 #6
0
 public Task <bool> Handle(SimpleMessage message)
 {
     HandleWasCalled = true;
     TaskHelpers.DelaySendDone(_doneSignal);
     return(Task.FromResult(true));
 }