-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* fix variable can be null if disabledelayeddelivery is true * Add transport test to verify that transport functions when delayed delivery is turned off * Cleanup * Simplify --------- Co-authored-by: Phil Bastian <[email protected]>
- Loading branch information
1 parent
ebc6e71
commit 3f053a3
Showing
4 changed files
with
75 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
src/NServiceBus.Transport.PostgreSql.TransportTests/When_delayed_delivery_disabled.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
namespace NServiceBus.TransportTests | ||
{ | ||
using System.Threading.Tasks; | ||
using NUnit.Framework; | ||
using Transport; | ||
|
||
public class When_delayed_delivery_disabled : NServiceBusTransportTest | ||
{ | ||
[TestCase(TransportTransactionMode.None)] | ||
[TestCase(TransportTransactionMode.ReceiveOnly)] | ||
[TestCase(TransportTransactionMode.SendsAtomicWithReceive)] | ||
[TestCase(TransportTransactionMode.TransactionScope)] | ||
public async Task Should_work(TransportTransactionMode transactionMode) | ||
{ | ||
CustomizeTransportDefinition = definition => | ||
{ | ||
((PostgreSqlTransport)definition).DisableDelayedDelivery = true; | ||
}; | ||
|
||
var onReceived = CreateTaskCompletionSource<MessageContext>(); | ||
|
||
await StartPump( | ||
(context, _) => | ||
{ | ||
onReceived.SetResult(context); | ||
return Task.CompletedTask; | ||
}, | ||
(_, __) => Task.FromResult(ErrorHandleResult.Handled), | ||
transactionMode); | ||
|
||
await SendMessage(InputQueueName); | ||
|
||
var ctx = await onReceived.Task; | ||
|
||
Assert.That(ctx, Is.Not.Null); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters