File tree Expand file tree Collapse file tree 1 file changed +17
-22
lines changed Expand file tree Collapse file tree 1 file changed +17
-22
lines changed Original file line number Diff line number Diff line change @@ -72,39 +72,34 @@ public virtual async Task InitializeAsync()
72
72
73
73
public virtual async Task DisposeAsync ( )
74
74
{
75
- if ( _management is not null )
75
+ if ( _management is not null && _management . State == State . Open )
76
76
{
77
- if ( _management . State == State . Open )
77
+ try
78
78
{
79
- try
80
- {
81
- IQueueSpecification queueSpecification = _management . Queue ( _queueName ) ;
82
- await queueSpecification . DeleteAsync ( ) ;
83
- }
84
- catch
85
- {
86
- }
79
+ IQueueSpecification queueSpecification = _management . Queue ( _queueName ) ;
80
+ await queueSpecification . DeleteAsync ( ) ;
81
+ }
82
+ catch
83
+ {
84
+ }
87
85
88
- try
89
- {
90
- IExchangeSpecification exchangeSpecification = _management . Exchange ( _exchangeName ) ;
91
- await exchangeSpecification . DeleteAsync ( ) ;
92
- }
93
- catch
94
- {
95
- }
86
+ try
87
+ {
88
+ IExchangeSpecification exchangeSpecification = _management . Exchange ( _exchangeName ) ;
89
+ await exchangeSpecification . DeleteAsync ( ) ;
90
+ }
91
+ catch
92
+ {
96
93
}
94
+
97
95
await _management . CloseAsync ( ) ;
98
96
Assert . Equal ( State . Closed , _management . State ) ;
99
97
_management . Dispose ( ) ;
100
98
}
101
99
102
100
if ( _connection is not null && _connection . State == State . Open )
103
101
{
104
- if ( _connection . State == State . Open )
105
- {
106
- await _connection . CloseAsync ( ) ;
107
- }
102
+ await _connection . CloseAsync ( ) ;
108
103
Assert . Equal ( State . Closed , _connection . State ) ;
109
104
_connection . Dispose ( ) ;
110
105
}
You can’t perform that action at this time.
0 commit comments