mirror of
https://github.com/zoriya/octokit.net.git
synced 2026-06-01 10:25:36 +00:00
renaming things is hard
This commit is contained in:
@@ -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),
|
||||
|
||||
@@ -179,7 +179,7 @@ namespace Octokit.Tests.Http
|
||||
sealed class HttpClientAdapterTester : HttpClientAdapter
|
||||
{
|
||||
public HttpClientAdapterTester()
|
||||
: base (HttpMessageHandlerFactory.GetHandler)
|
||||
: base(HttpMessageHandlerFactory.CreateDefault)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -92,7 +92,7 @@ namespace Octokit
|
||||
/// <param name="credentialStore">Provides credentials to the client when making requests</param>
|
||||
[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())
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
{
|
||||
|
||||
+1
-1
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user