public async Task WriteAsyncAndSaveChanges_SomeMessages_MessagesAddedToQueue() { 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.CommitAsync(); await _dbContext.SaveChangesAsync(); _dbContext.Outbox.Should().HaveCount(3); }
public void EnqueueCommitAndSaveChanges_SomeMessages_MessagesAddedToQueue() { _queueWriter.WriteAsync(SampleOutboundEnvelope); _queueWriter.WriteAsync(SampleOutboundEnvelope); _queueWriter.WriteAsync(SampleOutboundEnvelope); _queueWriter.CommitAsync(); _dbContext.SaveChanges(); _dbContext.Outbox.Should().HaveCount(3); }