public void ProcessAsync_ExceptionWhileProcessingItem_ThrowException() { var queue = new SingleItemQueue(new StringItem("An item")); var handler = new ThrowExceptionPayloadHandler(new Exception("An exception")); var queueProcessor = new DefaultQueueProcessor <string>(queue, handler); Assert.ThrowsAsync <Exception>(() => queueProcessor.ProcessAsync()); }
public void ProcessAsync_ExceptionWhileProcessingItem_ThrowExceptionAndUpdatesItem() { var queue = new SingleItemStatefulQueue(new StringItem("An item")); var handler = new ThrowExceptionPayloadHandler(new Exception("An exception")); var queueProcessor = new StatefulQueueProcessor <string>(queue, handler); Assert.ThrowsAsync <Exception>(() => queueProcessor.ProcessAsync()); Assert.IsTrue(queue.UpdateWasCalled); }