public RepostCommandHandlerMissingStoreTests()
        {
            var fakeMessageStoreFactory = FakeMessageStoreViewerFactory.CreateEmptyFactory();

            _command = new RepostCommand {
                MessageIds = new List <string> {
                    Guid.NewGuid().ToString()
                }, StoreName = _storeName
            };
            _fakeMessageProducer = new FakeMessageProducer();
            _repostHandler       = new RepostCommandHandler(fakeMessageStoreFactory, new FakeMessageProducerFactoryProvider(new FakeMessageProducerFactory(_fakeMessageProducer)), new MessageRecoverer());
        }
        public RepostCommandHandlerMessagesNotFoundTests()
        {
            var fakeStore = new FakeMessageStoreWithViewer();
            var fakeMessageStoreFactory = new FakeMessageStoreViewerFactory(fakeStore, _storeName);

            _command = new RepostCommand {
                MessageIds = new List <string> {
                    Guid.NewGuid().ToString()
                }, StoreName = _storeName
            };
            _fakeMessageProducer = new FakeMessageProducer();
            _repostHandler       = new RepostCommandHandler(fakeMessageStoreFactory, new FakeMessageProducerFactoryProvider(new FakeMessageProducerFactory(_fakeMessageProducer)), new MessageRecoverer());
        }
        public void Establish()
        {
            var fakeStore = new FakeMessageStoreWithViewer();

            _messageToRepost = new Message(new MessageHeader(Guid.NewGuid(), "a topic", MessageType.MT_COMMAND, DateTime.UtcNow), new MessageBody("body"));
            fakeStore.Add(_messageToRepost);
            var fakeMessageStoreFactory = new FakeMessageStoreViewerFactory(fakeStore, _storeName);

            _command = new RepostCommand {
                MessageIds = new List <string> {
                    _messageToRepost.Header.Id.ToString()
                }, StoreName = _storeName
            };
            _repostHandler = new RepostCommandHandler(fakeMessageStoreFactory, new FakeMessageProducerFactoryProvider(new FakeErrorProducingMessageProducerFactory()), new MessageRecoverer());
        }