public void Should_save_with_not_dispatched()
        {
            var id = Guid.NewGuid().ToString("N");
            var sessionFactory = new RavenSessionFactory(store);

            var persister = new OutboxPersister(sessionFactory) { DocumentStore = store, EndpointName = "TestEndpoint" };
            persister.Store(id, new List<TransportOperation>
            {
                new TransportOperation(id, new Dictionary<string, string>(), new byte[1024*5], new Dictionary<string, string>()),
            });

            sessionFactory.SaveChanges();
            sessionFactory.ReleaseSession();

            OutboxMessage result;
            persister.TryGet(id, out result);

            var operation = result.TransportOperations.Single();

            Assert.AreEqual(id, operation.MessageId);
        }
        public void Should_get_messages_with_old_and_new_recordId_format(string outboxRecordIdPrefix)
        {
            var sessionFactory = new RavenSessionFactory(store);
            var persister = new OutboxPersister(sessionFactory) { DocumentStore = store, EndpointName = "TestEndpoint" };

            var messageId = Guid.NewGuid().ToString();

            //manually store an OutboxRecord to control the OutboxRecordId format
            sessionFactory.Session.Store(new OutboxRecord
            {
                MessageId = messageId,
                Dispatched = false,
                TransportOperations = new List<OutboxRecord.OutboxOperation>
                {
                    new OutboxRecord.OutboxOperation
                    {
                        Message = new byte[1024 * 5],
                        Headers = new Dictionary<string, string>(),
                        MessageId = messageId,
                        Options = new Dictionary<string, string>()
                    }
                }
            }, outboxRecordIdPrefix + messageId);

            sessionFactory.SaveChanges();
            sessionFactory.ReleaseSession();

            OutboxMessage result;
            persister.TryGet(messageId, out result);

            Assert.NotNull(result);
            Assert.AreEqual(messageId, result.MessageId);
        }