public void When_the_message_is_already_in_the_outbox() { _exception = Catch.Exception(() => _dynamoDbOutboxSync.Add(_messageEarliest)); //_should_ignore_the_duplicate_key_and_still_succeed _exception.Should().BeNull(); }
public DynamoDbOutboxWritingMessageTests() { var messageHeader = new MessageHeader( messageId: Guid.NewGuid(), topic: "test_topic", messageType: MessageType.MT_DOCUMENT, timeStamp: DateTime.UtcNow.AddDays(-1), handledCount: 5, delayedMilliseconds: 5, correlationId: Guid.NewGuid(), replyTo: "ReplyAddress", contentType: "text/plain"); messageHeader.Bag.Add(_key1, _value1); messageHeader.Bag.Add(_key2, _value2); messageHeader.Bag.Add(_key3, _value3); messageHeader.Bag.Add(_key4, _value4); messageHeader.Bag.Add(_key5, _value5); _messageEarliest = new Message(messageHeader, new MessageBody("message body")); _dynamoDbOutboxSync = new DynamoDbOutboxSync(Client, new DynamoDbConfiguration(Credentials, RegionEndpoint.EUWest1, TableName)); _dynamoDbOutboxSync.Add(_messageEarliest); }