public PostgreSqlOutboxEmptyStoreTests()
        {
            _PostgreSqlTestHelper = new PostgreSqlTestHelper();
            _PostgreSqlTestHelper.SetupMessageDb();

            _sqlOutbox       = new PostgreSqlOutbox(_PostgreSqlTestHelper.OutboxConfiguration);
            _messageEarliest = new Message(new MessageHeader(Guid.NewGuid(), "test_topic", MessageType.MT_DOCUMENT), new MessageBody("message body"));
        }
Esempio n. 2
0
        public SqlOutboxWritingMessageTests()
        {
            _PostgreSqlTestHelper = new PostgreSqlTestHelper();
            _PostgreSqlTestHelper.SetupMessageDb();

            _sqlOutbox = new PostgreSqlOutbox(_PostgreSqlTestHelper.OutboxConfiguration);
            var messageHeader = new MessageHeader(Guid.NewGuid(), "test_topic", MessageType.MT_DOCUMENT, DateTime.UtcNow.AddDays(-1), 5, 5);

            messageHeader.Bag.Add(_key1, _value1);
            messageHeader.Bag.Add(_key2, _value2);

            _messageEarliest = new Message(messageHeader, new MessageBody("message body"));
            _sqlOutbox.Add(_messageEarliest);
        }
        public PostgreSqlOutboxRangeRequestTests()
        {
            _PostgreSqlTestHelper = new PostgreSqlTestHelper();
            _PostgreSqlTestHelper.SetupMessageDb();

            _sqlOutbox = new PostgreSqlOutbox(_PostgreSqlTestHelper.OutboxConfiguration);
            var messageEarliest = new Message(new MessageHeader(Guid.NewGuid(), _TopicFirstMessage, MessageType.MT_DOCUMENT), new MessageBody("message body"));
            var message1        = new Message(new MessageHeader(Guid.NewGuid(), "test_topic2", MessageType.MT_DOCUMENT), new MessageBody("message body2"));
            var message2        = new Message(new MessageHeader(Guid.NewGuid(), _TopicLastMessage, MessageType.MT_DOCUMENT), new MessageBody("message body3"));

            _sqlOutbox.Add(messageEarliest);
            Task.Delay(100);
            _sqlOutbox.Add(message1);
            Task.Delay(100);
            _sqlOutbox.Add(message2);
        }
Esempio n. 4
0
        public SqlOutboxWritngMessagesTests()
        {
            _PostgreSqlTestHelper = new PostgreSqlTestHelper();
            _PostgreSqlTestHelper.SetupMessageDb();

            _sqlOutbox       = new PostgreSqlOutbox(_PostgreSqlTestHelper.OutboxConfiguration);
            _messageEarliest = new Message(new MessageHeader(Guid.NewGuid(), "Test", MessageType.MT_COMMAND, DateTime.UtcNow.AddHours(-3)), new MessageBody("Body"));
            _sqlOutbox.Add(_messageEarliest);

            var message2 = new Message(new MessageHeader(Guid.NewGuid(), "Test2", MessageType.MT_COMMAND, DateTime.UtcNow.AddHours(-2)), new MessageBody("Body2"));

            _sqlOutbox.Add(message2);

            _messageLatest = new Message(new MessageHeader(Guid.NewGuid(), "Test3", MessageType.MT_COMMAND, DateTime.UtcNow.AddHours(-1)), new MessageBody("Body3"));
            _sqlOutbox.Add(_messageLatest);
        }