public async Task ReceivesSentMessageWhenTransactionIsCommitted() { using (var scope = new RebusTransactionScope()) { await _transport.Send(QueueName, RecognizableMessage(), scope.TransactionContext); await scope.CompleteAsync(); } using (var scope = new RebusTransactionScope()) { var transportMessage = await _transport.Receive(scope.TransactionContext, _cancellationToken); await scope.CompleteAsync(); AssertMessageIsRecognized(transportMessage); } }
public async Task ReceivesSentMessageWhenTransactionIsCommitted() { using (var context = new DefaultTransactionContext()) { await _transport.Send(QueueName, RecognizableMessage(), context); await context.Complete(); } using (var context = new DefaultTransactionContext()) { var transportMessage = await _transport.Receive(context); await context.Complete(); AssertMessageIsRecognized(transportMessage); } }