public async Task WriteAsyncAndRollbackAsync_SomeMessages_TableStillEmpty()
        {
            await _queueWriter.WriteAsync(
                _sampleOutboundEnvelope.Message,
                _sampleOutboundEnvelope.RawMessage.ReadAll(),
                _sampleOutboundEnvelope.Headers,
                _sampleOutboundEnvelope.Endpoint.Name,
                _sampleOutboundEnvelope.ActualEndpointName);

            await _queueWriter.WriteAsync(
                _sampleOutboundEnvelope.Message,
                _sampleOutboundEnvelope.RawMessage.ReadAll(),
                _sampleOutboundEnvelope.Headers,
                _sampleOutboundEnvelope.Endpoint.Name,
                _sampleOutboundEnvelope.ActualEndpointName);

            await _queueWriter.WriteAsync(
                _sampleOutboundEnvelope.Message,
                _sampleOutboundEnvelope.RawMessage.ReadAll(),
                _sampleOutboundEnvelope.Headers,
                _sampleOutboundEnvelope.Endpoint.Name,
                _sampleOutboundEnvelope.ActualEndpointName);

            await _queueWriter.RollbackAsync();

            _dbContext.Outbox.Should().HaveCount(0);
        }
Ejemplo n.º 2
0
        public void EnqueueAndRollback_SomeMessages_TableStillEmpty()
        {
            _queueWriter.WriteAsync(SampleOutboundEnvelope);
            _queueWriter.WriteAsync(SampleOutboundEnvelope);
            _queueWriter.WriteAsync(SampleOutboundEnvelope);
            _queueWriter.RollbackAsync();

            _dbContext.Outbox.Should().HaveCount(0);
        }