Skip to content

Commit

Permalink
Use correct HTTP client result in XunitException message
Browse files Browse the repository at this point in the history
  • Loading branch information
lukebakken committed Aug 31, 2022
1 parent ece98ef commit fc84f76
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Tests/Utils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -220,10 +220,10 @@ public static async Task<int> HttpKillConnections(string connectionName)
* https://stackoverflow.com/a/4550600
*/
var s = Uri.EscapeDataString(conn.name);
var r = await client.DeleteAsync($"http://localhost:15672/api/connections/{s}");
if (!r.IsSuccessStatusCode)
var deleteResult = await client.DeleteAsync($"http://localhost:15672/api/connections/{s}");
if (!deleteResult.IsSuccessStatusCode)
{
throw new XunitException($"HTTP DELETE failed: {result.StatusCode} {result.ReasonPhrase}");
throw new XunitException($"HTTP DELETE failed: {deleteResult.StatusCode} {deleteResult.ReasonPhrase}");
}

killed += 1;
Expand Down

0 comments on commit fc84f76

Please sign in to comment.