diff --git a/Octokit.Reactive/Helpers/ConnectionExtensions.cs b/Octokit.Reactive/Helpers/ConnectionExtensions.cs index f4d3daf2..b9afa982 100644 --- a/Octokit.Reactive/Helpers/ConnectionExtensions.cs +++ b/Octokit.Reactive/Helpers/ConnectionExtensions.cs @@ -23,13 +23,13 @@ namespace Octokit.Reactive.Internal } static IObservable GetPages(Uri uri, IDictionary parameters, - Func, IObservable>>> getPageFunc) + Func, IObservable>>> getPageFunc) { return getPageFunc(uri, parameters).Expand(resp => { var nextPageUrl = resp.ApiInfo.GetNextPageUrl(); return nextPageUrl == null - ? Observable.Empty>>() + ? Observable.Empty>>() : Observable.Defer(() => getPageFunc(nextPageUrl, null)); }) .Where(resp => resp != null) diff --git a/Octokit.Tests/Clients/AssigneesClientTests.cs b/Octokit.Tests/Clients/AssigneesClientTests.cs index 559ccb4b..6039d6fc 100644 --- a/Octokit.Tests/Clients/AssigneesClientTests.cs +++ b/Octokit.Tests/Clients/AssigneesClientTests.cs @@ -44,7 +44,7 @@ namespace Octokit.Tests.Clients [InlineData(HttpStatusCode.NotFound, false)] public async Task RequestsCorrectValueForStatusCode(HttpStatusCode status, bool expected) { - var response = Task.Factory.StartNew>(() => + var response = Task.Factory.StartNew>(() => new ApiResponse { StatusCode = status }); var connection = Substitute.For(); connection.Get(Arg.Is(u => u.ToString() == "repos/foo/bar/assignees/cody"), @@ -61,7 +61,7 @@ namespace Octokit.Tests.Clients [Fact] public async Task ThrowsExceptionForInvalidStatusCode() { - var response = Task.Factory.StartNew>(() => + var response = Task.Factory.StartNew>(() => new ApiResponse { StatusCode = HttpStatusCode.Conflict }); var connection = Substitute.For(); connection.Get(Arg.Is(u => u.ToString() == "repos/foo/bar/assignees/cody"), diff --git a/Octokit.Tests/Clients/FollowersClientTests.cs b/Octokit.Tests/Clients/FollowersClientTests.cs index 3d7d3314..95a28846 100644 --- a/Octokit.Tests/Clients/FollowersClientTests.cs +++ b/Octokit.Tests/Clients/FollowersClientTests.cs @@ -111,7 +111,7 @@ namespace Octokit.Tests.Clients [InlineData(HttpStatusCode.NotFound, false)] public async Task RequestsCorrectValueForStatusCode(HttpStatusCode status, bool expected) { - var response = Task.Factory.StartNew>(() => + var response = Task.Factory.StartNew>(() => new ApiResponse { StatusCode = status }); var connection = Substitute.For(); connection.Get(Arg.Is(u => u.ToString() == "user/following/alfhenrik"), @@ -128,7 +128,7 @@ namespace Octokit.Tests.Clients [Fact] public async Task ThrowsExceptionForInvalidStatusCode() { - var response = Task.Factory.StartNew>(() => + var response = Task.Factory.StartNew>(() => new ApiResponse { StatusCode = HttpStatusCode.Conflict }); var connection = Substitute.For(); connection.Get(Arg.Is(u => u.ToString() == "user/following/alfhenrik"), @@ -158,7 +158,7 @@ namespace Octokit.Tests.Clients [InlineData(HttpStatusCode.NotFound, false)] public async Task RequestsCorrectValueForStatusCode(HttpStatusCode status, bool expected) { - var response = Task.Factory.StartNew>(() => + var response = Task.Factory.StartNew>(() => new ApiResponse { StatusCode = status }); var connection = Substitute.For(); connection.Get(Arg.Is(u => u.ToString() == "users/alfhenrik/following/alfhenrik-test"), @@ -175,7 +175,7 @@ namespace Octokit.Tests.Clients [Fact] public async Task ThrowsExceptionForInvalidStatusCode() { - var response = Task.Factory.StartNew>(() => + var response = Task.Factory.StartNew>(() => new ApiResponse { StatusCode = HttpStatusCode.Conflict }); var connection = Substitute.For(); connection.Get(Arg.Is(u => u.ToString() == "users/alfhenrik/following/alfhenrik-test"), @@ -207,7 +207,7 @@ namespace Octokit.Tests.Clients [InlineData(HttpStatusCode.NoContent, true)] public async Task RequestsCorrectValueForStatusCode(HttpStatusCode status, bool expected) { - var response = Task.Factory.StartNew>(() => + var response = Task.Factory.StartNew>(() => new ApiResponse { StatusCode = status }); var connection = Substitute.For(); connection.Put(Arg.Is(u => u.ToString() == "user/following/alfhenrik"), @@ -224,7 +224,7 @@ namespace Octokit.Tests.Clients [Fact] public async Task ThrowsExceptionForInvalidStatusCode() { - var response = Task.Factory.StartNew>(() => + var response = Task.Factory.StartNew>(() => new ApiResponse { StatusCode = HttpStatusCode.Conflict }); var connection = Substitute.For(); connection.Put(Arg.Is(u => u.ToString() == "user/following/alfhenrik"), diff --git a/Octokit.Tests/Clients/GistsClientTests.cs b/Octokit.Tests/Clients/GistsClientTests.cs index 51a61865..6dca943c 100644 --- a/Octokit.Tests/Clients/GistsClientTests.cs +++ b/Octokit.Tests/Clients/GistsClientTests.cs @@ -196,7 +196,7 @@ public class GistsClientTests [InlineData(HttpStatusCode.NotFound, false)] public async Task RequestsCorrectValueForStatusCode(HttpStatusCode status, bool expected) { - var response = Task.Factory.StartNew>(() => + var response = Task.Factory.StartNew>(() => new ApiResponse { StatusCode = status }); var connection = Substitute.For(); connection.Get(Arg.Is(u => u.ToString() == "gists/1/star"), @@ -213,7 +213,7 @@ public class GistsClientTests [Fact] public async Task ThrowsExceptionForInvalidStatusCode() { - var response = Task.Factory.StartNew>(() => + var response = Task.Factory.StartNew>(() => new ApiResponse { StatusCode = HttpStatusCode.Conflict }); var connection = Substitute.For(); connection.Get(Arg.Is(u => u.ToString() == "gists/1/star"), diff --git a/Octokit.Tests/Clients/MiscellaneousClientTests.cs b/Octokit.Tests/Clients/MiscellaneousClientTests.cs index 8145bed1..659e5cca 100644 --- a/Octokit.Tests/Clients/MiscellaneousClientTests.cs +++ b/Octokit.Tests/Clients/MiscellaneousClientTests.cs @@ -16,7 +16,7 @@ namespace Octokit.Tests.Clients { var links = new Dictionary(); var scopes = new List(); - IResponse response = new ApiResponse + IApiResponse response = new ApiResponse { ApiInfo = new ApiInfo(links, scopes, scopes, "", new RateLimit(new Dictionary())), Body = "Test" @@ -44,7 +44,7 @@ namespace Octokit.Tests.Clients { var links = new Dictionary(); var scopes = new List(); - IResponse> response = new ApiResponse> + IApiResponse> response = new ApiResponse> { ApiInfo = new ApiInfo(links, scopes, scopes, "", new RateLimit(new Dictionary())), BodyAsObject = new Dictionary diff --git a/Octokit.Tests/Clients/OauthClientTests.cs b/Octokit.Tests/Clients/OauthClientTests.cs index f473072b..ce80cd32 100644 --- a/Octokit.Tests/Clients/OauthClientTests.cs +++ b/Octokit.Tests/Clients/OauthClientTests.cs @@ -55,7 +55,7 @@ public class OauthClientTests public async Task PostsWithCorrectBodyAndContentType() { var responseToken = new OauthToken(); - var response = Substitute.For>(); + var response = Substitute.For>(); response.BodyAsObject.Returns(responseToken); var connection = Substitute.For(); connection.BaseAddress.Returns(new Uri("https://api.github.com/")); diff --git a/Octokit.Tests/Clients/OrganizationMembersClientTests.cs b/Octokit.Tests/Clients/OrganizationMembersClientTests.cs index b577c017..3428876e 100644 --- a/Octokit.Tests/Clients/OrganizationMembersClientTests.cs +++ b/Octokit.Tests/Clients/OrganizationMembersClientTests.cs @@ -103,7 +103,7 @@ namespace Octokit.Tests.Clients [InlineData(HttpStatusCode.Found, false)] public async Task RequestsCorrectValueForStatusCode(HttpStatusCode status, bool expected) { - var response = Task.Factory.StartNew>(() => + var response = Task.Factory.StartNew>(() => new ApiResponse { StatusCode = status }); var connection = Substitute.For(); connection.Get(Arg.Is(u => u.ToString() == "orgs/org/members/username"), @@ -120,7 +120,7 @@ namespace Octokit.Tests.Clients [Fact] public async Task ThrowsExceptionForInvalidStatusCode() { - var response = Task.Factory.StartNew>(() => + var response = Task.Factory.StartNew>(() => new ApiResponse { StatusCode = HttpStatusCode.Conflict }); var connection = Substitute.For(); connection.Get(Arg.Is(u => u.ToString() == "orgs/org/members/username"), @@ -151,7 +151,7 @@ namespace Octokit.Tests.Clients [InlineData(HttpStatusCode.NotFound, false)] public async Task RequestsCorrectValueForStatusCode(HttpStatusCode status, bool expected) { - var response = Task.Factory.StartNew>(() => + var response = Task.Factory.StartNew>(() => new ApiResponse { StatusCode = status }); var connection = Substitute.For(); connection.Get(Arg.Is(u => u.ToString() == "orgs/org/public_members/username"), @@ -168,7 +168,7 @@ namespace Octokit.Tests.Clients [Fact] public async Task ThrowsExceptionForInvalidStatusCode() { - var response = Task.Factory.StartNew>(() => + var response = Task.Factory.StartNew>(() => new ApiResponse { StatusCode = HttpStatusCode.Conflict }); var connection = Substitute.For(); connection.Get(Arg.Is(u => u.ToString() == "orgs/org/public_members/username"), @@ -223,7 +223,7 @@ namespace Octokit.Tests.Clients [InlineData(HttpStatusCode.NoContent, true)] public async Task RequestsCorrectValueForStatusCode(HttpStatusCode status, bool expected) { - var response = Task.Factory.StartNew>(() => + var response = Task.Factory.StartNew>(() => new ApiResponse { StatusCode = status }); var connection = Substitute.For(); connection.Put(Arg.Is(u => u.ToString() == "orgs/org/public_members/username"), @@ -240,7 +240,7 @@ namespace Octokit.Tests.Clients [Fact] public async Task ThrowsExceptionForInvalidStatusCode() { - var response = Task.Factory.StartNew>(() => + var response = Task.Factory.StartNew>(() => new ApiResponse { StatusCode = HttpStatusCode.Conflict }); var connection = Substitute.For(); connection.Put(Arg.Is(u => u.ToString() == "orgs/org/public_members/username"), diff --git a/Octokit.Tests/Clients/RepoCollaboratorsClientTests.cs b/Octokit.Tests/Clients/RepoCollaboratorsClientTests.cs index 92497cfa..9616673f 100644 --- a/Octokit.Tests/Clients/RepoCollaboratorsClientTests.cs +++ b/Octokit.Tests/Clients/RepoCollaboratorsClientTests.cs @@ -55,7 +55,7 @@ namespace Octokit.Tests.Clients [InlineData(HttpStatusCode.NotFound, false)] public async Task RequestsCorrectValueForStatusCode(HttpStatusCode status, bool expected) { - var response = Task.Factory.StartNew>(() => + var response = Task.Factory.StartNew>(() => new ApiResponse { StatusCode = status }); var connection = Substitute.For(); connection.Get(Arg.Is(u => u.ToString() == "repos/owner/test/collaborators/user1"), @@ -72,7 +72,7 @@ namespace Octokit.Tests.Clients [Fact] public async Task ThrowsExceptionForInvalidStatusCode() { - var response = Task.Factory.StartNew>(() => + var response = Task.Factory.StartNew>(() => new ApiResponse { StatusCode = HttpStatusCode.Conflict }); var connection = Substitute.For(); connection.Get(Arg.Is(u => u.ToString() == "repos/foo/bar/assignees/cody"), diff --git a/Octokit.Tests/Clients/StarredClientTests.cs b/Octokit.Tests/Clients/StarredClientTests.cs index 8621ba51..5a714737 100644 --- a/Octokit.Tests/Clients/StarredClientTests.cs +++ b/Octokit.Tests/Clients/StarredClientTests.cs @@ -62,7 +62,7 @@ namespace Octokit.Tests.Clients [InlineData(HttpStatusCode.NotFound, false)] public async Task ReturnsCorrectResultBasedOnStatus(HttpStatusCode status, bool expected) { - var response = Task.Factory.StartNew>(() => + var response = Task.Factory.StartNew>(() => new ApiResponse { StatusCode = status }); var connection = Substitute.For(); connection.Get(Arg.Is(u => u.ToString() == "user/starred/yes/no"), null, null) @@ -85,7 +85,7 @@ namespace Octokit.Tests.Clients [InlineData(HttpStatusCode.OK, false)] public async Task ReturnsCorrectResultBasedOnStatus(HttpStatusCode status, bool expected) { - var response = Task.Factory.StartNew>(() => + var response = Task.Factory.StartNew>(() => new ApiResponse { StatusCode = status }); var connection = Substitute.For(); diff --git a/Octokit.Tests/Http/ApiConnectionTests.cs b/Octokit.Tests/Http/ApiConnectionTests.cs index 2d95344f..df20bef1 100644 --- a/Octokit.Tests/Http/ApiConnectionTests.cs +++ b/Octokit.Tests/Http/ApiConnectionTests.cs @@ -19,7 +19,7 @@ namespace Octokit.Tests.Http public async Task MakesGetRequestForItem() { var getUri = new Uri("anything", UriKind.Relative); - IResponse response = new ApiResponse {BodyAsObject = new object()}; + IApiResponse response = new ApiResponse {BodyAsObject = new object()}; var connection = Substitute.For(); connection.Get(Args.Uri, null, null).Returns(Task.FromResult(response)); var apiConnection = new ApiConnection(connection); @@ -35,7 +35,7 @@ namespace Octokit.Tests.Http { var getUri = new Uri("anything", UriKind.Relative); var accepts = "custom/accepts"; - IResponse response = new ApiResponse { BodyAsObject = new object() }; + IApiResponse response = new ApiResponse { BodyAsObject = new object() }; var connection = Substitute.For(); connection.Get(Args.Uri, null, Args.String).Returns(Task.FromResult(response)); var apiConnection = new ApiConnection(connection); @@ -62,7 +62,7 @@ namespace Octokit.Tests.Http public async Task MakesHtmlRequest() { var getUri = new Uri("anything", UriKind.Relative); - IResponse response = new ApiResponse {Body = ""}; + IApiResponse response = new ApiResponse {Body = ""}; var connection = Substitute.For(); connection.GetHtml(Args.Uri, null).Returns(Task.FromResult(response)); var apiConnection = new ApiConnection(connection); @@ -89,7 +89,7 @@ namespace Octokit.Tests.Http var getAllUri = new Uri("anything", UriKind.Relative); var links = new Dictionary(); var scopes = new List(); - IResponse> response = new ApiResponse> + IApiResponse> response = new ApiResponse> { ApiInfo = new ApiInfo(links, scopes, scopes, "etag", new RateLimit(new Dictionary())), BodyAsObject = new List {new object(), new object()} @@ -129,7 +129,7 @@ namespace Octokit.Tests.Http { var patchUri = new Uri("anything", UriKind.Relative); var sentData = new object(); - IResponse response = new ApiResponse {BodyAsObject = new object()}; + IApiResponse response = new ApiResponse {BodyAsObject = new object()}; var connection = Substitute.For(); connection.Patch(Args.Uri, Args.Object).Returns(Task.FromResult(response)); var apiConnection = new ApiConnection(connection); @@ -146,7 +146,7 @@ namespace Octokit.Tests.Http var patchUri = new Uri("anything", UriKind.Relative); var sentData = new object(); var accepts = "custom/accepts"; - IResponse response = new ApiResponse { BodyAsObject = new object() }; + IApiResponse response = new ApiResponse { BodyAsObject = new object() }; var connection = Substitute.For(); connection.Patch(Args.Uri, Args.Object, Args.String).Returns(Task.FromResult(response)); var apiConnection = new ApiConnection(connection); @@ -175,7 +175,7 @@ namespace Octokit.Tests.Http { var postUri = new Uri("anything", UriKind.Relative); var sentData = new object(); - IResponse response = new ApiResponse {BodyAsObject = new object()}; + IApiResponse response = new ApiResponse {BodyAsObject = new object()}; var connection = Substitute.For(); connection.Post(Args.Uri, Args.Object, null, null).Returns(Task.FromResult(response)); var apiConnection = new ApiConnection(connection); @@ -190,7 +190,7 @@ namespace Octokit.Tests.Http public async Task MakesUploadRequest() { var uploadUrl = new Uri("anything", UriKind.Relative); - IResponse response = new ApiResponse {BodyAsObject = "the response"}; + IApiResponse response = new ApiResponse {BodyAsObject = "the response"}; var connection = Substitute.For(); connection.Post(Args.Uri, Arg.Any(), Args.String, Args.String) .Returns(Task.FromResult(response)); @@ -229,7 +229,7 @@ namespace Octokit.Tests.Http { var putUri = new Uri("anything", UriKind.Relative); var sentData = new object(); - IResponse response = new ApiResponse { BodyAsObject = new object() }; + IApiResponse response = new ApiResponse { BodyAsObject = new object() }; var connection = Substitute.For(); connection.Put(Args.Uri, Args.Object).Returns(Task.FromResult(response)); var apiConnection = new ApiConnection(connection); @@ -245,7 +245,7 @@ namespace Octokit.Tests.Http { var putUri = new Uri("anything", UriKind.Relative); var sentData = new object(); - IResponse response = new ApiResponse { BodyAsObject = new object() }; + IApiResponse response = new ApiResponse { BodyAsObject = new object() }; var connection = Substitute.For(); connection.Put(Args.Uri, Args.Object, "two-factor").Returns(Task.FromResult(response)); var apiConnection = new ApiConnection(connection); @@ -312,7 +312,7 @@ namespace Octokit.Tests.Http var queuedOperationUrl = new Uri("anything", UriKind.Relative); const HttpStatusCode statusCode = HttpStatusCode.OK; - IResponse response = new ApiResponse { BodyAsObject = new object(), StatusCode = statusCode }; + IApiResponse response = new ApiResponse { BodyAsObject = new object(), StatusCode = statusCode }; var connection = Substitute.For(); connection.GetResponse(queuedOperationUrl,Args.CancellationToken).Returns(Task.FromResult(response)); var apiConnection = new ApiConnection(connection); @@ -328,7 +328,7 @@ namespace Octokit.Tests.Http var queuedOperationUrl = new Uri("anything", UriKind.Relative); const HttpStatusCode statusCode = HttpStatusCode.PartialContent; - IResponse response = new ApiResponse { BodyAsObject = new object(), StatusCode = statusCode }; + IApiResponse response = new ApiResponse { BodyAsObject = new object(), StatusCode = statusCode }; var connection = Substitute.For(); connection.GetResponse(queuedOperationUrl, Args.CancellationToken).Returns(Task.FromResult(response)); var apiConnection = new ApiConnection(connection); @@ -343,7 +343,7 @@ namespace Octokit.Tests.Http var result = new object(); const HttpStatusCode statusCode = HttpStatusCode.OK; - IResponse response = new ApiResponse { BodyAsObject = result, StatusCode = statusCode }; + IApiResponse response = new ApiResponse { BodyAsObject = result, StatusCode = statusCode }; var connection = Substitute.For(); connection.GetResponse(queuedOperationUrl, Args.CancellationToken).Returns(Task.FromResult(response)); var apiConnection = new ApiConnection(connection); @@ -358,8 +358,8 @@ namespace Octokit.Tests.Http var queuedOperationUrl = new Uri("anything", UriKind.Relative); var result = new object(); - IResponse firstResponse = new ApiResponse { BodyAsObject = result, StatusCode = HttpStatusCode.Accepted }; - IResponse completedResponse = new ApiResponse { BodyAsObject = result, StatusCode = HttpStatusCode.OK }; + IApiResponse firstResponse = new ApiResponse { BodyAsObject = result, StatusCode = HttpStatusCode.Accepted }; + IApiResponse completedResponse = new ApiResponse { BodyAsObject = result, StatusCode = HttpStatusCode.OK }; var connection = Substitute.For(); connection.GetResponse(queuedOperationUrl, Args.CancellationToken) .Returns(x => Task.FromResult(firstResponse), @@ -378,7 +378,7 @@ namespace Octokit.Tests.Http var queuedOperationUrl = new Uri("anything", UriKind.Relative); var result = new object(); - IResponse accepted = new ApiResponse { BodyAsObject = result, StatusCode = HttpStatusCode.Accepted }; + IApiResponse accepted = new ApiResponse { BodyAsObject = result, StatusCode = HttpStatusCode.Accepted }; var connection = Substitute.For(); connection.GetResponse(queuedOperationUrl, Args.CancellationToken).Returns(x => Task.FromResult(accepted)); diff --git a/Octokit.Tests/Http/JsonHttpPipelineTests.cs b/Octokit.Tests/Http/JsonHttpPipelineTests.cs index e558935f..9738de0e 100644 --- a/Octokit.Tests/Http/JsonHttpPipelineTests.cs +++ b/Octokit.Tests/Http/JsonHttpPipelineTests.cs @@ -1,5 +1,4 @@ using System; -using System.Collections; using System.Collections.Generic; using System.IO; using System.Linq; @@ -140,14 +139,14 @@ namespace Octokit.Tests.Http public void DeserializesSingleObjectResponseIntoCollectionWithOneItem() { const string data = "{\"name\":\"Haack\"}"; - var response = new ApiResponse> + var httpResponse = new ApiResponse> { Body = data, ContentType = "application/json" }; var jsonPipeline = new JsonHttpPipeline(); - jsonPipeline.DeserializeResponse(response); + var response = jsonPipeline.DeserializeResponse>(httpResponse); Assert.Equal(1, response.BodyAsObject.Count); Assert.Equal("Haack", response.BodyAsObject.First().Name); diff --git a/Octokit.Tests/Models/ReadOnlyPagedCollectionTests.cs b/Octokit.Tests/Models/ReadOnlyPagedCollectionTests.cs index 9ec82c82..9f504e55 100644 --- a/Octokit.Tests/Models/ReadOnlyPagedCollectionTests.cs +++ b/Octokit.Tests/Models/ReadOnlyPagedCollectionTests.cs @@ -15,7 +15,7 @@ namespace Octokit.Tests.Models public async Task ReturnsTheNextPage() { var nextPageUrl = new Uri("https://example.com/page/2"); - var nextPageResponse = Task.Factory.StartNew>>(() => + var nextPageResponse = Task.Factory.StartNew>>(() => new ApiResponse> {BodyAsObject = new List {new object(), new object()}}); var links = new Dictionary {{"next", nextPageUrl}}; var scopes = new List(); diff --git a/Octokit.Tests/Reactive/ObservableIssuesClientTests.cs b/Octokit.Tests/Reactive/ObservableIssuesClientTests.cs index f2363815..6eaacbf3 100644 --- a/Octokit.Tests/Reactive/ObservableIssuesClientTests.cs +++ b/Octokit.Tests/Reactive/ObservableIssuesClientTests.cs @@ -81,11 +81,11 @@ public class ObservableIssuesClientTests && d["state"] == "open" && d["sort"] == "created" && d["filter"] == "assigned"), Arg.Any()) - .Returns(Task.Factory.StartNew>>(() => firstPageResponse)); + .Returns(Task.Factory.StartNew>>(() => firstPageResponse)); gitHubClient.Connection.Get>(secondPageUrl, null, null) - .Returns(Task.Factory.StartNew>>(() => secondPageResponse)); + .Returns(Task.Factory.StartNew>>(() => secondPageResponse)); gitHubClient.Connection.Get>(thirdPageUrl, null, null) - .Returns(Task.Factory.StartNew>>(() => lastPageResponse)); + .Returns(Task.Factory.StartNew>>(() => lastPageResponse)); var client = new ObservableIssuesClient(gitHubClient); var results = await client.GetForRepository("fake", "repo").ToArray(); @@ -130,7 +130,7 @@ public class ObservableIssuesClientTests { BodyAsObject = new List { - CreateIssue(7) + CreateIssue(7), }, ApiInfo = CreateApiInfo(new Dictionary()) }; @@ -141,11 +141,11 @@ public class ObservableIssuesClientTests && d["state"] == "open" && d["sort"] == "created" && d["filter"] == "assigned"), Arg.Any()) - .Returns(Task.Factory.StartNew>>(() => firstPageResponse)); + .Returns(Task.Factory.StartNew>>(() => firstPageResponse)); gitHubClient.Connection.Get>(secondPageUrl, null, null) - .Returns(Task.Factory.StartNew>>(() => secondPageResponse)); + .Returns(Task.Factory.StartNew>>(() => secondPageResponse)); gitHubClient.Connection.Get>(thirdPageUrl, null, null) - .Returns(Task.Factory.StartNew>>(() => lastPageResponse)); + .Returns(Task.Factory.StartNew>>(() => lastPageResponse)); var client = new ObservableIssuesClient(gitHubClient); var results = await client.GetAllForOwnedAndMemberRepositories().ToArray(); @@ -202,11 +202,11 @@ public class ObservableIssuesClientTests && d["state"] == "open" && d["sort"] == "created" && d["filter"] == "assigned"), Arg.Any()) - .Returns(Task.Factory.StartNew>>(() => firstPageResponse)); + .Returns(Task.Factory.StartNew>>(() => firstPageResponse)); gitHubClient.Connection.Get>(secondPageUrl, null, null) - .Returns(Task.Factory.StartNew>>(() => secondPageResponse)); + .Returns(Task.Factory.StartNew>>(() => secondPageResponse)); gitHubClient.Connection.Get>(thirdPageUrl, null, null) - .Returns(Task.Factory.StartNew>>(() => lastPageResponse)); + .Returns(Task.Factory.StartNew>>(() => lastPageResponse)); var client = new ObservableIssuesClient(gitHubClient); var results = await client.GetAllForOrganization("test").ToArray(); @@ -263,11 +263,11 @@ public class ObservableIssuesClientTests && d["state"] == "open" && d["sort"] == "created" && d["filter"] == "assigned"), Arg.Any()) - .Returns(Task.Factory.StartNew>>(() => firstPageResponse)); + .Returns(Task.Factory.StartNew>>(() => firstPageResponse)); gitHubClient.Connection.Get>(secondPageUrl, null, null) - .Returns(Task.Factory.StartNew>>(() => secondPageResponse)); + .Returns(Task.Factory.StartNew>>(() => secondPageResponse)); gitHubClient.Connection.Get>(thirdPageUrl, null, null) - .Returns(Task.Factory.StartNew>>(() => lastPageResponse)); + .Returns(Task.Factory.StartNew>>(() => lastPageResponse)); var client = new ObservableIssuesClient(gitHubClient); var results = await client.GetAllForCurrent().ToArray(); diff --git a/Octokit.Tests/Reactive/ObservableMilestonesClientTests.cs b/Octokit.Tests/Reactive/ObservableMilestonesClientTests.cs index 62fd5721..f245b22c 100644 --- a/Octokit.Tests/Reactive/ObservableMilestonesClientTests.cs +++ b/Octokit.Tests/Reactive/ObservableMilestonesClientTests.cs @@ -77,11 +77,11 @@ namespace Octokit.Tests.Reactive }; var gitHubClient = Substitute.For(); gitHubClient.Connection.Get>(firstPageUrl, null, null) - .Returns(Task.Factory.StartNew>>(() => firstPageResponse)); + .Returns(Task.Factory.StartNew>>(() => firstPageResponse)); gitHubClient.Connection.Get>(secondPageUrl, null, null) - .Returns(Task.Factory.StartNew>>(() => secondPageResponse)); + .Returns(Task.Factory.StartNew>>(() => secondPageResponse)); gitHubClient.Connection.Get>(thirdPageUrl, null, null) - .Returns(Task.Factory.StartNew>>(() => lastPageResponse)); + .Returns(Task.Factory.StartNew>>(() => lastPageResponse)); var client = new ObservableMilestonesClient(gitHubClient); var results = await client.GetForRepository("fake", "repo").ToArray(); @@ -134,11 +134,11 @@ namespace Octokit.Tests.Reactive && d["direction"] == "desc" && d["state"] == "open" && d["sort"] == "due_date"), Arg.Any()) - .Returns(Task.Factory.StartNew>>(() => firstPageResponse)); + .Returns(Task.Factory.StartNew>>(() => firstPageResponse)); gitHubClient.Connection.Get>(secondPageUrl, null, null) - .Returns(Task.Factory.StartNew>>(() => secondPageResponse)); + .Returns(Task.Factory.StartNew>>(() => secondPageResponse)); gitHubClient.Connection.Get>(thirdPageUrl, null, null) - .Returns(Task.Factory.StartNew>>(() => lastPageResponse)); + .Returns(Task.Factory.StartNew>>(() => lastPageResponse)); var client = new ObservableMilestonesClient(gitHubClient); var results = await client.GetForRepository("fake", "repo", new MilestoneRequest { SortDirection = SortDirection.Descending }).ToArray(); diff --git a/Octokit.Tests/Reactive/ObservablePullRequestReviewCommentsClientTests.cs b/Octokit.Tests/Reactive/ObservablePullRequestReviewCommentsClientTests.cs index 83c598e5..9121bac8 100644 --- a/Octokit.Tests/Reactive/ObservablePullRequestReviewCommentsClientTests.cs +++ b/Octokit.Tests/Reactive/ObservablePullRequestReviewCommentsClientTests.cs @@ -58,11 +58,11 @@ namespace Octokit.Tests.Reactive var gitHubClient = Substitute.For(); gitHubClient.Connection.Get>(firstPageUrl, null, null) - .Returns(Task.Factory.StartNew>>(() => firstPageResponse)); + .Returns(Task.Factory.StartNew>>(() => firstPageResponse)); gitHubClient.Connection.Get>(secondPageUrl, null, null) - .Returns(Task.Factory.StartNew>>(() => secondPageResponse)); + .Returns(Task.Factory.StartNew>>(() => secondPageResponse)); gitHubClient.Connection.Get>(thirdPageUrl, null, null) - .Returns(Task.Factory.StartNew>>(() => lastPageResponse)); + .Returns(Task.Factory.StartNew>>(() => lastPageResponse)); var client = new ObservablePullRequestReviewCommentsClient(gitHubClient); @@ -136,11 +136,11 @@ namespace Octokit.Tests.Reactive && d["direction"] == "desc" && d["since"] == "2013-11-15T11:43:01Z" && d["sort"] == "updated"), null) - .Returns(Task.Factory.StartNew>>(() => firstPageResponse)); + .Returns(Task.Factory.StartNew>>(() => firstPageResponse)); gitHubClient.Connection.Get>(secondPageUrl, null, null) - .Returns(Task.Factory.StartNew>>(() => secondPageResponse)); + .Returns(Task.Factory.StartNew>>(() => secondPageResponse)); gitHubClient.Connection.Get>(thirdPageUrl, null, null) - .Returns(Task.Factory.StartNew>>(() => lastPageResponse)); + .Returns(Task.Factory.StartNew>>(() => lastPageResponse)); var client = new ObservablePullRequestReviewCommentsClient(gitHubClient); @@ -207,11 +207,11 @@ namespace Octokit.Tests.Reactive Arg.Is>(d => d.Count == 2 && d["direction"] == "asc" && d["sort"] == "created"), null) - .Returns(Task.Factory.StartNew>>(() => firstPageResponse)); + .Returns(Task.Factory.StartNew>>(() => firstPageResponse)); gitHubClient.Connection.Get>(secondPageUrl, null, null) - .Returns(Task.Factory.StartNew>>(() => secondPageResponse)); + .Returns(Task.Factory.StartNew>>(() => secondPageResponse)); gitHubClient.Connection.Get>(thirdPageUrl, null, null) - .Returns(Task.Factory.StartNew>>(() => lastPageResponse)); + .Returns(Task.Factory.StartNew>>(() => lastPageResponse)); var client = new ObservablePullRequestReviewCommentsClient(gitHubClient); diff --git a/Octokit.Tests/Reactive/ObservablePullRequestsClientTests.cs b/Octokit.Tests/Reactive/ObservablePullRequestsClientTests.cs index 36c2b80a..fe7b12a6 100644 --- a/Octokit.Tests/Reactive/ObservablePullRequestsClientTests.cs +++ b/Octokit.Tests/Reactive/ObservablePullRequestsClientTests.cs @@ -77,11 +77,11 @@ namespace Octokit.Tests.Reactive }; var gitHubClient = Substitute.For(); gitHubClient.Connection.Get>(firstPageUrl, null, null) - .Returns(Task.Factory.StartNew>>(() => firstPageResponse)); + .Returns(Task.Factory.StartNew>>(() => firstPageResponse)); gitHubClient.Connection.Get>(secondPageUrl, null, null) - .Returns(Task.Factory.StartNew>>(() => secondPageResponse)); + .Returns(Task.Factory.StartNew>>(() => secondPageResponse)); gitHubClient.Connection.Get>(thirdPageUrl, null, null) - .Returns(Task.Factory.StartNew>>(() => lastPageResponse)); + .Returns(Task.Factory.StartNew>>(() => lastPageResponse)); var client = new ObservablePullRequestsClient(gitHubClient); var results = client.GetForRepository("fake", "repo").ToArray().Wait(); @@ -134,11 +134,11 @@ namespace Octokit.Tests.Reactive && d["head"] == "user:ref-name" && d["state"] == "open" && d["base"] == "fake_base_branch"), Arg.Any()) - .Returns(Task.Factory.StartNew>>(() => firstPageResponse)); + .Returns(Task.Factory.StartNew>>(() => firstPageResponse)); gitHubClient.Connection.Get>(secondPageUrl, null, null) - .Returns(Task.Factory.StartNew>>(() => secondPageResponse)); + .Returns(Task.Factory.StartNew>>(() => secondPageResponse)); gitHubClient.Connection.Get>(thirdPageUrl, null, null) - .Returns(Task.Factory.StartNew>>(() => lastPageResponse)); + .Returns(Task.Factory.StartNew>>(() => lastPageResponse)); var client = new ObservablePullRequestsClient(gitHubClient); var results = client.GetForRepository("fake", "repo", new PullRequestRequest { Head = "user:ref-name", Base = "fake_base_branch" }).ToArray().Wait(); @@ -281,7 +281,7 @@ namespace Octokit.Tests.Reactive var expectedUrl = string.Format("repos/fake/repo/pulls/42/commits"); var gitHubClient = Substitute.For(); var connection = Substitute.For(); - IResponse> response = new ApiResponse> + IApiResponse> response = new ApiResponse> { ApiInfo = new ApiInfo( new Dictionary(), diff --git a/Octokit.Tests/Reactive/ObservableRepositoriesClientTests.cs b/Octokit.Tests/Reactive/ObservableRepositoriesClientTests.cs index fd2ba49b..901f2211 100644 --- a/Octokit.Tests/Reactive/ObservableRepositoriesClientTests.cs +++ b/Octokit.Tests/Reactive/ObservableRepositoriesClientTests.cs @@ -19,7 +19,7 @@ namespace Octokit.Tests.Reactive public async Task IsALukeWarmObservable() { var repository = new Repository(); - var response = Task.Factory.StartNew>(() => + var response = Task.Factory.StartNew>(() => new ApiResponse { BodyAsObject = repository }); var connection = Substitute.For(); connection.Get(Args.Uri, null, null).Returns(response); @@ -80,11 +80,11 @@ namespace Octokit.Tests.Reactive }; var gitHubClient = Substitute.For(); gitHubClient.Connection.GetResponse>(firstPageUrl) - .Returns(Task.Factory.StartNew>>(() => firstPageResponse)); + .Returns(Task.Factory.StartNew>>(() => firstPageResponse)); gitHubClient.Connection.GetResponse>(secondPageUrl) - .Returns(Task.Factory.StartNew>>(() => secondPageResponse)); + .Returns(Task.Factory.StartNew>>(() => secondPageResponse)); gitHubClient.Connection.GetResponse>(thirdPageUrl) - .Returns(Task.Factory.StartNew>>(() => lastPageResponse)); + .Returns(Task.Factory.StartNew>>(() => lastPageResponse)); var repositoriesClient = new ObservableRepositoriesClient(gitHubClient); var results = await repositoriesClient.GetAllForCurrent().ToArray(); @@ -143,13 +143,13 @@ namespace Octokit.Tests.Reactive }; var gitHubClient = Substitute.For(); gitHubClient.Connection.GetResponse>(firstPageUrl) - .Returns(Task.Factory.StartNew>>(() => firstPageResponse)); + .Returns(Task.Factory.StartNew>>(() => firstPageResponse)); gitHubClient.Connection.GetResponse>(secondPageUrl) - .Returns(Task.Factory.StartNew>>(() => secondPageResponse)); + .Returns(Task.Factory.StartNew>>(() => secondPageResponse)); gitHubClient.Connection.GetResponse>(thirdPageUrl) - .Returns(Task.Factory.StartNew>>(() => thirdPageResponse)); + .Returns(Task.Factory.StartNew>>(() => thirdPageResponse)); gitHubClient.Connection.GetResponse>(fourthPageUrl) - .Returns(Task.Factory.StartNew>>(() => lastPageResponse)); + .Returns(Task.Factory.StartNew>>(() => lastPageResponse)); var repositoriesClient = new ObservableRepositoriesClient(gitHubClient); var results = await repositoriesClient.GetAllForCurrent().Take(4).ToArray(); diff --git a/Octokit/Helpers/ApiExtensions.cs b/Octokit/Helpers/ApiExtensions.cs index c3cda7fa..e2e8bd3f 100644 --- a/Octokit/Helpers/ApiExtensions.cs +++ b/Octokit/Helpers/ApiExtensions.cs @@ -65,7 +65,7 @@ namespace Octokit /// The connection to use /// URI endpoint to send request to /// representing the received HTTP response - public static Task> GetHtml(this IConnection connection, Uri uri) + public static Task> GetHtml(this IConnection connection, Uri uri) { Ensure.ArgumentNotNull(connection, "connection"); Ensure.ArgumentNotNull(uri, "uri"); @@ -81,7 +81,7 @@ namespace Octokit /// URI of the API resource to get /// The API resource. /// Thrown when an API error occurs. - public static Task> GetResponse(this IConnection connection, Uri uri) + public static Task> GetResponse(this IConnection connection, Uri uri) { Ensure.ArgumentNotNull(connection, "connection"); Ensure.ArgumentNotNull(uri, "uri"); @@ -98,7 +98,7 @@ namespace Octokit /// A token used to cancel the GetResponse request /// The API resource. /// Thrown when an API error occurs. - public static Task> GetResponse(this IConnection connection, Uri uri, CancellationToken cancellationToken) + public static Task> GetResponse(this IConnection connection, Uri uri, CancellationToken cancellationToken) { Ensure.ArgumentNotNull(connection, "connection"); Ensure.ArgumentNotNull(uri, "uri"); diff --git a/Octokit/Http/ApiResponse.cs b/Octokit/Http/ApiResponse.cs index 0bbdf4c3..039ffb6b 100644 --- a/Octokit/Http/ApiResponse.cs +++ b/Octokit/Http/ApiResponse.cs @@ -4,7 +4,7 @@ using System.Net; namespace Octokit.Internal { - public class ApiResponse : IResponse + public class ApiResponse : IApiResponse { public ApiResponse() { diff --git a/Octokit/Http/Connection.cs b/Octokit/Http/Connection.cs index ea994023..4bbe226d 100644 --- a/Octokit/Http/Connection.cs +++ b/Octokit/Http/Connection.cs @@ -135,14 +135,14 @@ namespace Octokit _jsonPipeline = new JsonHttpPipeline(); } - public Task> Get(Uri uri, IDictionary parameters, string accepts) + public Task> Get(Uri uri, IDictionary parameters, string accepts) { Ensure.ArgumentNotNull(uri, "uri"); return SendData(uri.ApplyParameters(parameters), HttpMethod.Get, null, accepts, null, CancellationToken.None); } - public Task> Get(Uri uri, IDictionary parameters, string accepts, CancellationToken cancellationToken) + public Task> Get(Uri uri, IDictionary parameters, string accepts, CancellationToken cancellationToken) { Ensure.ArgumentNotNull(uri, "uri"); @@ -155,7 +155,7 @@ namespace Octokit /// URI endpoint to send request to /// Querystring parameters for the request /// representing the received HTTP response - public Task> GetHtml(Uri uri, IDictionary parameters) + public Task> GetHtml(Uri uri, IDictionary parameters) { Ensure.ArgumentNotNull(uri, "uri"); @@ -167,7 +167,7 @@ namespace Octokit }); } - public Task> Patch(Uri uri, object body) + public Task> Patch(Uri uri, object body) { Ensure.ArgumentNotNull(uri, "uri"); Ensure.ArgumentNotNull(body, "body"); @@ -175,7 +175,7 @@ namespace Octokit return SendData(uri, HttpVerb.Patch, body, null, null, CancellationToken.None); } - public Task> Patch(Uri uri, object body, string accepts) + public Task> Patch(Uri uri, object body, string accepts) { Ensure.ArgumentNotNull(uri, "uri"); Ensure.ArgumentNotNull(body, "body"); @@ -184,7 +184,7 @@ namespace Octokit return SendData(uri, HttpVerb.Patch, body, accepts, null, CancellationToken.None); } - public Task> Post(Uri uri, object body, string accepts, string contentType) + public Task> Post(Uri uri, object body, string accepts, string contentType) { Ensure.ArgumentNotNull(uri, "uri"); Ensure.ArgumentNotNull(body, "body"); @@ -192,7 +192,7 @@ namespace Octokit return SendData(uri, HttpMethod.Post, body, accepts, contentType, CancellationToken.None); } - public Task> Post(Uri uri, object body, string accepts, string contentType, TimeSpan timeout) + public Task> Post(Uri uri, object body, string accepts, string contentType, TimeSpan timeout) { Ensure.ArgumentNotNull(uri, "uri"); Ensure.ArgumentNotNull(body, "body"); @@ -200,7 +200,7 @@ namespace Octokit return SendData(uri, HttpMethod.Post, body, accepts, contentType, timeout, CancellationToken.None); } - public Task> Post(Uri uri, object body, string accepts, string contentType, Uri baseAddress) + public Task> Post(Uri uri, object body, string accepts, string contentType, Uri baseAddress) { Ensure.ArgumentNotNull(uri, "uri"); Ensure.ArgumentNotNull(body, "body"); @@ -208,12 +208,12 @@ namespace Octokit return SendData(uri, HttpMethod.Post, body, accepts, contentType, CancellationToken.None, baseAddress: baseAddress); } - public Task> Put(Uri uri, object body) + public Task> Put(Uri uri, object body) { return SendData(uri, HttpMethod.Put, body, null, null, CancellationToken.None); } - public Task> Put(Uri uri, object body, string twoFactorAuthenticationCode) + public Task> Put(Uri uri, object body, string twoFactorAuthenticationCode) { return SendData(uri, HttpMethod.Put, @@ -224,7 +224,7 @@ namespace Octokit twoFactorAuthenticationCode); } - Task> SendData( + Task> SendData( Uri uri, HttpMethod method, object body, @@ -249,7 +249,7 @@ namespace Octokit return SendDataInternal(body, accepts, contentType, cancellationToken, twoFactorAuthenticationCode, request); } - Task> SendData( + Task> SendData( Uri uri, HttpMethod method, object body, @@ -271,7 +271,7 @@ namespace Octokit return SendDataInternal(body, accepts, contentType, cancellationToken, twoFactorAuthenticationCode, request); } - Task> SendDataInternal(object body, string accepts, string contentType, CancellationToken cancellationToken, string twoFactorAuthenticationCode, Request request) + Task> SendDataInternal(object body, string accepts, string contentType, CancellationToken cancellationToken, string twoFactorAuthenticationCode, Request request) { if (!String.IsNullOrEmpty(accepts)) { @@ -412,14 +412,14 @@ namespace Octokit } } - async Task> GetHtml(IRequest request) + async Task> GetHtml(IRequest request) { request.Headers.Add("Accept", "application/vnd.github.html"); var response = await RunRequest(request, CancellationToken.None); return new ApiResponse(response, response.Body); } - async Task> Run(IRequest request, CancellationToken cancellationToken) + async Task> Run(IRequest request, CancellationToken cancellationToken) { _jsonPipeline.SerializeRequest(request); var response = await RunRequest(request, cancellationToken).ConfigureAwait(false); diff --git a/Octokit/Http/IConnection.cs b/Octokit/Http/IConnection.cs index 8eea35fb..0a91746f 100644 --- a/Octokit/Http/IConnection.cs +++ b/Octokit/Http/IConnection.cs @@ -18,7 +18,7 @@ namespace Octokit /// URI endpoint to send request to /// Querystring parameters for the request /// representing the received HTTP response - Task> GetHtml(Uri uri, IDictionary parameters); + Task> GetHtml(Uri uri, IDictionary parameters); /// /// Performs an asynchronous HTTP GET request. @@ -30,7 +30,7 @@ namespace Octokit /// Specifies accepted response media types. /// representing the received HTTP response [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1716:IdentifiersShouldNotMatchKeywords", MessageId = "Get")] - Task> Get(Uri uri, IDictionary parameters, string accepts); + Task> Get(Uri uri, IDictionary parameters, string accepts); /// /// Performs an asynchronous HTTP GET request. @@ -43,7 +43,7 @@ namespace Octokit /// A token used to cancel the Get request /// representing the received HTTP response [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1716:IdentifiersShouldNotMatchKeywords", MessageId = "Get")] - Task> Get(Uri uri, IDictionary parameters, string accepts, CancellationToken cancellationToken); + Task> Get(Uri uri, IDictionary parameters, string accepts, CancellationToken cancellationToken); /// /// Performs an asynchronous HTTP PATCH request. @@ -60,7 +60,7 @@ namespace Octokit /// URI endpoint to send request to /// The object to serialize as the body of the request /// representing the received HTTP response - Task> Patch(Uri uri, object body); + Task> Patch(Uri uri, object body); /// /// Performs an asynchronous HTTP PATCH request. @@ -71,7 +71,7 @@ namespace Octokit /// The object to serialize as the body of the request /// Specifies accepted response media types. /// representing the received HTTP response - Task> Patch(Uri uri, object body, string accepts); + Task> Patch(Uri uri, object body, string accepts); /// /// Performs an asynchronous HTTP POST request. @@ -83,7 +83,7 @@ namespace Octokit /// Specifies accepted response media types. /// Specifies the media type of the request body /// representing the received HTTP response - Task> Post(Uri uri, object body, string accepts, string contentType); + Task> Post(Uri uri, object body, string accepts, string contentType); /// /// Performs an asynchronous HTTP POST request. @@ -96,7 +96,7 @@ namespace Octokit /// Specifies the media type of the request body /// /// representing the received HTTP response - Task> Post(Uri uri, object body, string accepts, string contentType, TimeSpan timeout); + Task> Post(Uri uri, object body, string accepts, string contentType, TimeSpan timeout); /// @@ -114,7 +114,7 @@ namespace Octokit /// Specifies the media type of the request body /// Allows overriding the base address for a post. /// representing the received HTTP response - Task> Post(Uri uri, object body, string accepts, string contentType, Uri baseAddress); + Task> Post(Uri uri, object body, string accepts, string contentType, Uri baseAddress); /// /// Performs an asynchronous HTTP PUT request. @@ -124,7 +124,7 @@ namespace Octokit /// URI endpoint to send request to /// The body of the request /// representing the received HTTP response - Task> Put(Uri uri, object body); + Task> Put(Uri uri, object body); /// /// Performs an asynchronous HTTP PUT request using the provided two factor authentication code. @@ -135,7 +135,7 @@ namespace Octokit /// The object to serialize as the body of the request /// Two factory authentication code to use /// representing the received HTTP response - Task> Put(Uri uri, object body, string twoFactorAuthenticationCode); + Task> Put(Uri uri, object body, string twoFactorAuthenticationCode); /// /// Performs an asynchronous HTTP PUT request that expects an empty response. diff --git a/Octokit/Http/IResponse.cs b/Octokit/Http/IResponse.cs index 7c839a49..f90fddb5 100644 --- a/Octokit/Http/IResponse.cs +++ b/Octokit/Http/IResponse.cs @@ -4,7 +4,7 @@ using System.Net; namespace Octokit { - public interface IResponse : IResponse + public interface IApiResponse : IResponse { new T BodyAsObject { get; set; } } diff --git a/Octokit/Http/JsonHttpPipeline.cs b/Octokit/Http/JsonHttpPipeline.cs index 24cc4764..735d742f 100644 --- a/Octokit/Http/JsonHttpPipeline.cs +++ b/Octokit/Http/JsonHttpPipeline.cs @@ -39,7 +39,7 @@ namespace Octokit.Internal request.Body = _serializer.Serialize(request.Body); } - public IResponse DeserializeResponse(IResponse response) + public IApiResponse DeserializeResponse(IResponse response) { Ensure.ArgumentNotNull(response, "response"); diff --git a/Octokit/Http/ReadOnlyPagedCollection.cs b/Octokit/Http/ReadOnlyPagedCollection.cs index 743b7aae..0c013124 100644 --- a/Octokit/Http/ReadOnlyPagedCollection.cs +++ b/Octokit/Http/ReadOnlyPagedCollection.cs @@ -8,9 +8,9 @@ namespace Octokit.Internal public class ReadOnlyPagedCollection : ReadOnlyCollection, IReadOnlyPagedCollection { readonly ApiInfo _info; - readonly Func>>> _nextPageFunc; + readonly Func>>> _nextPageFunc; - public ReadOnlyPagedCollection(IResponse> response, Func>>> nextPageFunc) + public ReadOnlyPagedCollection(IApiResponse> response, Func>>> nextPageFunc) : base(response != null ? response.BodyAsObject : null) { Ensure.ArgumentNotNull(response, "response");