gh-gei icon indicating copy to clipboard operation
gh-gei copied to clipboard

Dispose HTTP response in BbsClient and AdoClient

Open ArinGhazarian opened this issue 2 years ago • 0 comments

I noticed that in BbsClient and AdoClient we are not disposing the HTTP response that is getting returned by the HttpClient. The response needs to be immediately disposed with a using statement and also all unit tests need to be fixed the way they were fixed in #925.

Todo

  • [ ] Dispose the http response in BbsClient#SendAsync() and AdoClient#SendAsync() methods
  • [ ] Fix unit tests by using a factory to return a new HttpResponseMessage when mocking HttpMessageHandler (see #925)
  • [ ] Bonus: Simplify SendAsync method in both BbsClient and AdoClient by replacing the switch statement with HttpClient#SendAsync() the way it is in GithubClient#SendAsync().

ArinGhazarian avatar Apr 01 '23 04:04 ArinGhazarian