@@ -24,7 +24,7 @@ public class RabbitMqPriorityQueueTest : FixtureBase
2424
2525 protected override void SetUp ( )
2626 {
27- RabbitMqTransportFactory . DeleteQueue ( _priorityQueueName ) ;
27+ RabbitMqTransportFactory . DeleteQueue ( _priorityQueueName ) . GetAwaiter ( ) . GetResult ( ) ;
2828 }
2929
3030 [ Test ]
@@ -34,24 +34,24 @@ public void PriorityInputQueueCreate()
3434 Using ( StartServer ( _priorityQueueName , 10 ) ) ;
3535
3636 // Check if queues exists
37- Assert . DoesNotThrow ( ( ) =>
37+ Assert . That ( async ( ) =>
3838 {
3939 var connectionFactory = new ConnectionFactory { Uri = new Uri ( RabbitMqTransportFactory . ConnectionString ) } ;
4040
41- using var connection = connectionFactory . CreateConnection ( ) ;
41+ await using var connection = await connectionFactory . CreateConnectionAsync ( ) ;
4242
43- using var model = connection . CreateModel ( ) ;
43+ await using var model = await connection . CreateChannelAsync ( ) ;
4444
4545 // Throws exception if queue paramters differ
46- model . QueueDeclare ( _priorityQueueName ,
46+ await model . QueueDeclareAsync ( _priorityQueueName ,
4747 exclusive : false ,
4848 durable : true ,
4949 autoDelete : false ,
5050 arguments : new Dictionary < string , object >
5151 {
5252 { "x-max-priority" , 10 }
5353 } ) ;
54- } ) ;
54+ } , Throws . Nothing ) ;
5555 }
5656
5757 [ Test ]
@@ -60,23 +60,23 @@ public void PriorityInputQueueCreateThrowsOnDifferentPriority()
6060 // Start a server with priority
6161 Using ( StartServer ( _priorityQueueName , 10 ) ) ;
6262
63- Assert . Throws < OperationInterruptedException > ( ( ) =>
63+ Assert . That ( async ( ) =>
6464 {
6565 var connectionFactory = new ConnectionFactory { Uri = new Uri ( RabbitMqTransportFactory . ConnectionString ) } ;
6666
67- using var connection = connectionFactory . CreateConnection ( ) ;
67+ await using var connection = await connectionFactory . CreateConnectionAsync ( ) ;
6868
69- using var model = connection . CreateModel ( ) ;
69+ await using var model = await connection . CreateChannelAsync ( ) ;
7070
71- model . QueueDeclare ( _priorityQueueName ,
71+ await model . QueueDeclareAsync ( _priorityQueueName ,
7272 exclusive : false ,
7373 durable : true ,
7474 autoDelete : false ,
7575 arguments : new Dictionary < string , object >
7676 {
7777 { "x-max-priority" , 1 }
7878 } ) ;
79- } ) ;
79+ } , Throws . TypeOf < OperationInterruptedException > ( ) ) ;
8080 }
8181
8282 [ Test ]
0 commit comments