Pagination support to Reactions Clients (#1948)

* Add pagination to *CommitCommentReactionsClient

* Add unit tests for *CommitCommentReactionsClient

* Add integration tests for *CommitCommentReactionsClient

* Add pagination to *IssueCommentReactionsClient

* Add unit tests for *IssueCommentReactionsClient

* Add integration tests for *IssueCommentReactionsClient

* Add pagination to *IssueReactionsClient

* Add unit tests for *IssueReactionsClient

* Add integration tests for *IssueReactionsClient

* Add pagination to *PullRequestReviewCommentReactionsClient

* Add unit tests for *PullRequestReviewCommentReactionsClient

* Add integration tests for *PullRequestReviewCommentReactionsClient

* Remove rogue using statement and whitespace

* Add null check tests for GetAll with repositoryid overload
This commit is contained in:
Henrik Andersson
2019-02-27 21:29:33 +10:00
committed by Ryan Gribble
parent 33f75ed149
commit 43381c4a53
28 changed files with 1591 additions and 36 deletions
@@ -26,7 +26,25 @@ namespace Octokit.Tests.Reactive
client.GetAll("fake", "repo", 42);
gitHubClient.Received().Reaction.IssueComment.GetAll("fake", "repo", 42);
gitHubClient.Received().Reaction.IssueComment.GetAll("fake", "repo", 42, Args.ApiOptions);
}
[Fact]
public void RequestsCorrectUrlApiOptions()
{
var gitHubClient = Substitute.For<IGitHubClient>();
var client = new ObservableIssueCommentReactionsClient(gitHubClient);
var options = new ApiOptions
{
PageCount = 1,
StartPage = 1,
PageSize = 1
};
client.GetAll("fake", "repo", 42, options);
gitHubClient.Received().Reaction.IssueComment.GetAll("fake", "repo", 42, options);
}
[Fact]
@@ -37,7 +55,25 @@ namespace Octokit.Tests.Reactive
client.GetAll(1, 42);
gitHubClient.Received().Reaction.IssueComment.GetAll(1, 42);
gitHubClient.Received().Reaction.IssueComment.GetAll(1, 42, Args.ApiOptions);
}
[Fact]
public void RequestsCorrectUrlWithRepositoryIdApiOptions()
{
var gitHubClient = Substitute.For<IGitHubClient>();
var client = new ObservableIssueCommentReactionsClient(gitHubClient);
var options = new ApiOptions
{
PageCount = 1,
StartPage = 1,
PageSize = 1
};
client.GetAll(1, 42, options);
gitHubClient.Received().Reaction.IssueComment.GetAll(1, 42, options);
}
[Fact]
@@ -48,10 +84,20 @@ namespace Octokit.Tests.Reactive
Assert.Throws<ArgumentNullException>(() => client.GetAll(null, "name", 1));
Assert.Throws<ArgumentNullException>(() => client.GetAll("owner", null, 1));
Assert.Throws<ArgumentNullException>(() => client.GetAll("owner", "name", 1, null));
Assert.Throws<ArgumentException>(() => client.GetAll("", "name", 1));
Assert.Throws<ArgumentException>(() => client.GetAll("owner", "", 1));
}
[Fact]
public void EnsuresArgumentsNotNullWithRepositoryId()
{
var gitHubClient = Substitute.For<IGitHubClient>();
var client = new ObservableIssueCommentReactionsClient(gitHubClient);
Assert.Throws<ArgumentNullException>(() => client.GetAll(1, 1, null));
}
}
public class TheCreateMethod