コード例 #1
0
 public void Setup(MessageStoreType type, FakeMessageStoreWithViewer fakeMessageStoreWithViewer)
 {
     _messageStoreConfigCache.Set(type, msli =>
     {
         if (!ctorCalled.ContainsKey(type))
         {
             ctorCalled.Add(type,0);
         }
         ctorCalled[type]++;
         return fakeMessageStoreWithViewer;
     });
 }
コード例 #2
0
        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());
        }
コード例 #3
0
        public MessageListModelRetrieverFilterOnBodyTests()
        {
            _messages = new List <Message> {
                new Message(new MessageHeader(Guid.NewGuid(), "MyTopic1", MessageType.MT_COMMAND), new MessageBody("topic3")),
                new Message(new MessageHeader(Guid.NewGuid(), "MyTopic2", MessageType.MT_COMMAND), new MessageBody(""))
            };

            var fakeStore = new FakeMessageStoreWithViewer();

            _messages.ForEach(m => fakeStore.Add(m));
            var modelFactory = new FakeMessageStoreViewerFactory(fakeStore, _storeName);

            _messageListViewModelRetriever = new MessageListViewModelRetriever(modelFactory);
        }
        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());
        }
コード例 #5
0
        public void Establish()
        {
            _message1 = new Message(new MessageHeader(Guid.NewGuid(), "MyTopic1", MessageType.MT_COMMAND), new MessageBody("a body"));
            var messageHeader = new MessageHeader(Guid.NewGuid(), "MyTopic2", MessageType.MT_COMMAND);

            messageHeader.Bag.Add("bagVal1", "value1");
            messageHeader.Bag.Add("bagVal2", "value2");
            _messages = new List <Message> {
                _message1,
                new Message(messageHeader, new MessageBody(""))
            };

            var fakeStore = new FakeMessageStoreWithViewer();

            _messages.ForEach(m => fakeStore.Add(m));
            var modelFactory = new FakeMessageStoreViewerFactory(fakeStore, storeName);

            _messageListViewModelRetriever = new MessageListViewModelRetriever(modelFactory);
        }