From d7d7efd2c703b63a4a223278d7c8519732f9a9d5 Mon Sep 17 00:00:00 2001 From: Brendan Forster Date: Sun, 31 May 2015 20:34:29 +0930 Subject: [PATCH] renaming things is hard --- Octokit.Tests.Integration/HttpClientAdapterTests.cs | 4 ++-- Octokit.Tests/Http/HttpClientAdapterTests.cs | 2 +- Octokit/Http/Connection.cs | 2 +- Octokit/Http/HttpMessageHandlerFactory.cs | 6 +++--- docs/http-client.md | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Octokit.Tests.Integration/HttpClientAdapterTests.cs b/Octokit.Tests.Integration/HttpClientAdapterTests.cs index d1b1eb8d..72087350 100644 --- a/Octokit.Tests.Integration/HttpClientAdapterTests.cs +++ b/Octokit.Tests.Integration/HttpClientAdapterTests.cs @@ -14,7 +14,7 @@ public class HttpClientAdapterTests [IntegrationTest] public async Task CanDownloadImage() { - var httpClient = new HttpClientAdapter(HttpMessageHandlerFactory.GetHandler); + var httpClient = new HttpClientAdapter(HttpMessageHandlerFactory.CreateDefault); var request = new Request { BaseAddress = new Uri("https://github.global.ssl.fastly.net/", UriKind.Absolute), @@ -36,7 +36,7 @@ public class HttpClientAdapterTests [IntegrationTest] public async Task CanCancelARequest() { - var httpClient = new HttpClientAdapter(HttpMessageHandlerFactory.GetHandler); + var httpClient = new HttpClientAdapter(HttpMessageHandlerFactory.CreateDefault); var request = new Request { BaseAddress = new Uri("https://github.global.ssl.fastly.net/", UriKind.Absolute), diff --git a/Octokit.Tests/Http/HttpClientAdapterTests.cs b/Octokit.Tests/Http/HttpClientAdapterTests.cs index 7e77dc91..32cf42ac 100644 --- a/Octokit.Tests/Http/HttpClientAdapterTests.cs +++ b/Octokit.Tests/Http/HttpClientAdapterTests.cs @@ -179,7 +179,7 @@ namespace Octokit.Tests.Http sealed class HttpClientAdapterTester : HttpClientAdapter { public HttpClientAdapterTester() - : base (HttpMessageHandlerFactory.GetHandler) + : base(HttpMessageHandlerFactory.CreateDefault) { } diff --git a/Octokit/Http/Connection.cs b/Octokit/Http/Connection.cs index 3176aff7..c8597dad 100644 --- a/Octokit/Http/Connection.cs +++ b/Octokit/Http/Connection.cs @@ -92,7 +92,7 @@ namespace Octokit /// Provides credentials to the client when making requests [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Reliability", "CA2000:Dispose objects before losing scope")] public Connection(ProductHeaderValue productInformation, Uri baseAddress, ICredentialStore credentialStore) - : this(productInformation, baseAddress, credentialStore, new HttpClientAdapter(HttpMessageHandlerFactory.GetHandler), new SimpleJsonSerializer()) + : this(productInformation, baseAddress, credentialStore, new HttpClientAdapter(HttpMessageHandlerFactory.CreateDefault), new SimpleJsonSerializer()) { } diff --git a/Octokit/Http/HttpMessageHandlerFactory.cs b/Octokit/Http/HttpMessageHandlerFactory.cs index 3223a38f..0b778f5b 100644 --- a/Octokit/Http/HttpMessageHandlerFactory.cs +++ b/Octokit/Http/HttpMessageHandlerFactory.cs @@ -7,13 +7,13 @@ namespace Octokit.Internal public static class HttpMessageHandlerFactory { [SuppressMessage("Microsoft.Reliability", "CA2000:Dispose objects before losing scope")] - public static HttpClientHandler GetHandler() + public static HttpMessageHandler CreateDefault() { - return GetHandler(null); + return CreateDefault(null); } [SuppressMessage("Microsoft.Reliability", "CA2000:Dispose objects before losing scope")] - public static HttpClientHandler GetHandler(IWebProxy proxy) + public static HttpMessageHandler CreateDefault(IWebProxy proxy) { var handler = new HttpClientHandler { diff --git a/docs/http-client.md b/docs/http-client.md index 3b25d9cf..265ec7c4 100644 --- a/docs/http-client.md +++ b/docs/http-client.md @@ -38,7 +38,7 @@ var proxy = new WebProxy(); // this is the core connection var connection = new Connection(new ProductHeaderValue("my-cool-app"), - new HttpClientAdapter(() => HttpMessageHandlerFactory.GetHandler(proxy))); + new HttpClientAdapter(() => HttpMessageHandlerFactory.CreateDefault(proxy))); // and pass this connection to your client var client = new GitHubClient(connection);