Skip to content

Commit c0098c0

Browse files
committed
fixup
1 parent b840c7e commit c0098c0

File tree

1 file changed

+17
-22
lines changed

1 file changed

+17
-22
lines changed

Tests/IntegrationTest.cs

Lines changed: 17 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -72,39 +72,34 @@ public virtual async Task InitializeAsync()
7272

7373
public virtual async Task DisposeAsync()
7474
{
75-
if (_management is not null)
75+
if (_management is not null && _management.State == State.Open)
7676
{
77-
if (_management.State == State.Open)
77+
try
7878
{
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+
}
8785

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+
{
9693
}
94+
9795
await _management.CloseAsync();
9896
Assert.Equal(State.Closed, _management.State);
9997
_management.Dispose();
10098
}
10199

102100
if (_connection is not null && _connection.State == State.Open)
103101
{
104-
if (_connection.State == State.Open)
105-
{
106-
await _connection.CloseAsync();
107-
}
102+
await _connection.CloseAsync();
108103
Assert.Equal(State.Closed, _connection.State);
109104
_connection.Dispose();
110105
}

0 commit comments

Comments
 (0)