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
@@ -29,6 +29,24 @@ namespace Octokit.Tests.Reactive
gitHubClient.Received().Reaction.CommitComment.GetAll("fake", "repo", 42);
}
[Fact]
public void RequestsCorrectUrlApiOptions()
{
var gitHubClient = Substitute.For<IGitHubClient>();
var client = new ObservableCommitCommentReactionsClient(gitHubClient);
var options = new ApiOptions
{
PageCount = 1,
StartPage = 1,
PageSize = 1
};
client.GetAll("fake", "repo", 42, options);
gitHubClient.Received().Reaction.CommitComment.GetAll("fake", "repo", 42, options);
}
[Fact]
public void RequestsCorrectUrlWithRepositoryId()
{
@@ -40,6 +58,24 @@ namespace Octokit.Tests.Reactive
gitHubClient.Received().Reaction.CommitComment.GetAll(1, 42);
}
[Fact]
public void RequestsCorrectUrlWithRepositoryIdApiOptions()
{
var gitHubClient = Substitute.For<IGitHubClient>();
var client = new ObservableCommitCommentReactionsClient(gitHubClient);
var options = new ApiOptions
{
PageCount = 1,
StartPage = 1,
PageSize = 1
};
client.GetAll(1, 42, options);
gitHubClient.Received().Reaction.CommitComment.GetAll(1, 42, options);
}
[Fact]
public void EnsuresNotNullArguments()
{
@@ -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 EnsuresNotNullArgumentsWithRepositoryId()
{
var gitHubClient = Substitute.For<IGitHubClient>();
var client = new ObservableCommitCommentReactionsClient(gitHubClient);
Assert.Throws<ArgumentNullException>(() => client.GetAll(1, 1, null));
}
}
public class TheCreateMethod