public void should_remove_it_from_the_queue()
        {
            // Arrange
            var dynamicDataFactory = new Moq.Mock<DynamicDataStoreFactory>();
            dynamicDataFactory
                .Setup(x => x.GetStore(typeof (QueueItem)))
                .Returns(new InMemoryDynamicDataStore());

            var container = EPiSimpleQueue.Infrastructure.Bootstrapper.CreateContainer();

            var queueManager = new QueueManager(dynamicDataFactory.Object, new Handler(container));

            queueManager.Add(new AnEvent());

            // Act
            queueManager.ProcessAllQueueItems();

            // Assert
            Assert.That(queueManager.GetQueueItems(), Is.Empty);
        }
        public void Setup()
        {
            // Arrange
            _eventThatWillThrow = new AnEventThatWillThrow {Exception = new ArgumentException("Some exception")};

            var dynamicDataFactory = new Moq.Mock<DynamicDataStoreFactory>();
            dynamicDataFactory
                .Setup(x => x.GetStore(typeof(QueueItem)))
                .Returns(new InMemoryDynamicDataStore());

            dynamicDataFactory
                .Setup(x => x.GetStore(typeof(ErrorQueueItem)))
                .Returns(new InMemoryDynamicDataStore());

            var container = EPiSimpleQueue.Infrastructure.Bootstrapper.CreateContainer();

            _queueManager = new QueueManager(dynamicDataFactory.Object, new Handler(container));

            _queueManager.Add(_eventThatWillThrow);
            _queueManager.Add(new AnEvent());

            // Act
            _results = _queueManager.ProcessAllQueueItems();
        }