From 350a47090a94671f1297fd732dbf1d11247d8ff7 Mon Sep 17 00:00:00 2001 From: "aedampir@gmail.com" Date: Wed, 15 Jun 2016 15:35:09 +0700 Subject: [PATCH 01/12] modified XML docs --- .../Clients/IObservableCommitCommentReactionsClient.cs | 10 ++++++++-- .../Clients/ObservableCommitCommentReactionsClient.cs | 10 ++++++++-- Octokit/Clients/CommitCommentReactionsClient.cs | 10 ++++++++-- Octokit/Clients/ICommitCommentReactionsClient.cs | 10 ++++++++-- 4 files changed, 32 insertions(+), 8 deletions(-) diff --git a/Octokit.Reactive/Clients/IObservableCommitCommentReactionsClient.cs b/Octokit.Reactive/Clients/IObservableCommitCommentReactionsClient.cs index 174863fa..0557a16b 100644 --- a/Octokit.Reactive/Clients/IObservableCommitCommentReactionsClient.cs +++ b/Octokit.Reactive/Clients/IObservableCommitCommentReactionsClient.cs @@ -2,6 +2,12 @@ namespace Octokit.Reactive { + /// + /// A client for GitHub's Reactions API. + /// + /// + /// See the Reactions API documentation for more information. + /// public interface IObservableCommitCommentReactionsClient { /// @@ -12,7 +18,7 @@ namespace Octokit.Reactive /// The name of the repository /// The comment id /// The reaction to create - /// + /// A of representing created reaction for specified comment id. IObservable Create(string owner, string name, int number, NewReaction reaction); /// @@ -22,7 +28,7 @@ namespace Octokit.Reactive /// The owner of the repository /// The name of the repository /// The comment id - /// + /// A of s representing all reactions for specified comment id. IObservable GetAll(string owner, string name, int number); } } diff --git a/Octokit.Reactive/Clients/ObservableCommitCommentReactionsClient.cs b/Octokit.Reactive/Clients/ObservableCommitCommentReactionsClient.cs index e3d172ee..017960b3 100644 --- a/Octokit.Reactive/Clients/ObservableCommitCommentReactionsClient.cs +++ b/Octokit.Reactive/Clients/ObservableCommitCommentReactionsClient.cs @@ -4,6 +4,12 @@ using Octokit.Reactive.Internal; namespace Octokit.Reactive { + /// + /// A client for GitHub's Reactions API. + /// + /// + /// See the Reactions API documentation for more information. + /// public class ObservableCommitCommentReactionsClient : IObservableCommitCommentReactionsClient { readonly ICommitCommentReactionsClient _client; @@ -25,7 +31,7 @@ namespace Octokit.Reactive /// The name of the repository /// The comment id /// The reaction to create - /// + /// A of representing created reaction for specified comment id. public IObservable Create(string owner, string name, int number, NewReaction reaction) { Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); @@ -42,7 +48,7 @@ namespace Octokit.Reactive /// The owner of the repository /// The name of the repository /// The comment id - /// + /// A of s representing all reactions for specified comment id. public IObservable GetAll(string owner, string name, int number) { Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); diff --git a/Octokit/Clients/CommitCommentReactionsClient.cs b/Octokit/Clients/CommitCommentReactionsClient.cs index 000cddb5..3dca0f50 100644 --- a/Octokit/Clients/CommitCommentReactionsClient.cs +++ b/Octokit/Clients/CommitCommentReactionsClient.cs @@ -3,6 +3,12 @@ using System.Threading.Tasks; namespace Octokit { + /// + /// A client for GitHub's Reactions API. + /// + /// + /// See the Reactions API documentation for more information. + /// public class CommitCommentReactionsClient : ApiClient, ICommitCommentReactionsClient { public CommitCommentReactionsClient(IApiConnection apiConnection) @@ -18,7 +24,7 @@ namespace Octokit /// The name of the repository /// The comment id /// The reaction to create - /// + /// A representing created reaction for specified comment id. public Task Create(string owner, string name, int number, NewReaction reaction) { Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); @@ -35,7 +41,7 @@ namespace Octokit /// The owner of the repository /// The name of the repository /// The comment id - /// + /// A of s representing all reactions for specified comment id. public Task> GetAll(string owner, string name, int number) { Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); diff --git a/Octokit/Clients/ICommitCommentReactionsClient.cs b/Octokit/Clients/ICommitCommentReactionsClient.cs index 7e1c73bf..5bc0a0fa 100644 --- a/Octokit/Clients/ICommitCommentReactionsClient.cs +++ b/Octokit/Clients/ICommitCommentReactionsClient.cs @@ -3,6 +3,12 @@ using System.Threading.Tasks; namespace Octokit { + /// + /// A client for GitHub's Reactions API. + /// + /// + /// See the Reactions API documentation for more information. + /// public interface ICommitCommentReactionsClient { /// @@ -13,7 +19,7 @@ namespace Octokit /// The name of the repository /// The comment id /// The reaction to create - /// + /// A representing created reaction for specified comment id. Task Create(string owner, string name, int number, NewReaction reaction); /// @@ -23,7 +29,7 @@ namespace Octokit /// The owner of the repository /// The name of the repository /// The comment id - /// + /// A of s representing all reactions for specified comment id. Task> GetAll(string owner, string name, int number); } } From 88d706762bd98f111d66f0e9e2c1cf3ec21ae46c Mon Sep 17 00:00:00 2001 From: "aedampir@gmail.com" Date: Wed, 15 Jun 2016 15:42:30 +0700 Subject: [PATCH 02/12] added new url for reactions --- Octokit/Helpers/ApiUrls.cs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Octokit/Helpers/ApiUrls.cs b/Octokit/Helpers/ApiUrls.cs index ca28659d..d7fc6aee 100644 --- a/Octokit/Helpers/ApiUrls.cs +++ b/Octokit/Helpers/ApiUrls.cs @@ -424,6 +424,17 @@ namespace Octokit return "repos/{0}/{1}/comments/{2}/reactions".FormatUri(owner, name, number); } + /// + /// Returns the for the reaction of a specified commit comment. + /// + /// The ID of the repository + /// The comment number + /// + public static Uri CommitCommentReactions(int repositoryId, int number) + { + return "repositories/{0}/comments/{2}/reactions".FormatUri(repositoryId, number); + } + /// /// Returns the that returns all of the assignees to which issues may be assigned. /// From ff0105eb0eaedaed35b9f197644e459f38cf36c9 Mon Sep 17 00:00:00 2001 From: "aedampir@gmail.com" Date: Wed, 15 Jun 2016 15:42:37 +0700 Subject: [PATCH 03/12] added new overloads --- ...IObservableCommitCommentReactionsClient.cs | 19 +++++++++++++ .../ObservableCommitCommentReactionsClient.cs | 27 +++++++++++++++++++ .../Clients/CommitCommentReactionsClient.cs | 27 +++++++++++++++++++ .../Clients/ICommitCommentReactionsClient.cs | 19 +++++++++++++ 4 files changed, 92 insertions(+) diff --git a/Octokit.Reactive/Clients/IObservableCommitCommentReactionsClient.cs b/Octokit.Reactive/Clients/IObservableCommitCommentReactionsClient.cs index 0557a16b..9411e675 100644 --- a/Octokit.Reactive/Clients/IObservableCommitCommentReactionsClient.cs +++ b/Octokit.Reactive/Clients/IObservableCommitCommentReactionsClient.cs @@ -21,6 +21,16 @@ namespace Octokit.Reactive /// A of representing created reaction for specified comment id. IObservable Create(string owner, string name, int number, NewReaction reaction); + /// + /// Creates a reaction for a specified Commit Comment + /// + /// https://developer.github.com/v3/reactions/#create-reaction-for-a-commit-comment + /// The ID of the repository + /// The comment id + /// The reaction to create + /// A of representing created reaction for specified comment id. + IObservable Create(int repositoryId, int number, NewReaction reaction); + /// /// List reactions for a specified Commit Comment /// @@ -30,5 +40,14 @@ namespace Octokit.Reactive /// The comment id /// A of s representing all reactions for specified comment id. IObservable GetAll(string owner, string name, int number); + + /// + /// List reactions for a specified Commit Comment + /// + /// https://developer.github.com/v3/reactions/#list-reactions-for-a-commit-comment + /// The owner of the repository + /// The comment id + /// A of s representing all reactions for specified comment id. + IObservable GetAll(int repositoryId, int number); } } diff --git a/Octokit.Reactive/Clients/ObservableCommitCommentReactionsClient.cs b/Octokit.Reactive/Clients/ObservableCommitCommentReactionsClient.cs index 017960b3..f1c6c053 100644 --- a/Octokit.Reactive/Clients/ObservableCommitCommentReactionsClient.cs +++ b/Octokit.Reactive/Clients/ObservableCommitCommentReactionsClient.cs @@ -41,6 +41,21 @@ namespace Octokit.Reactive return _client.Create(owner, name, number, reaction).ToObservable(); } + /// + /// Creates a reaction for a specified Commit Comment + /// + /// https://developer.github.com/v3/reactions/#create-reaction-for-a-commit-comment + /// The ID of the repository + /// The comment id + /// The reaction to create + /// A of representing created reaction for specified comment id. + public IObservable Create(int repositoryId, int number, NewReaction reaction) + { + Ensure.ArgumentNotNull(reaction, "reaction"); + + return _client.Create(repositoryId, number, reaction).ToObservable(); + } + /// /// List reactions for a specified Commit Comment /// @@ -56,5 +71,17 @@ namespace Octokit.Reactive return _connection.GetAndFlattenAllPages(ApiUrls.CommitCommentReactions(owner, name, number), null, AcceptHeaders.ReactionsPreview); } + + /// + /// List reactions for a specified Commit Comment + /// + /// https://developer.github.com/v3/reactions/#list-reactions-for-a-commit-comment + /// The owner of the repository + /// The comment id + /// A of s representing all reactions for specified comment id. + public IObservable GetAll(int repositoryId, int number) + { + return _connection.GetAndFlattenAllPages(ApiUrls.CommitCommentReactions(repositoryId, number), null, AcceptHeaders.ReactionsPreview); + } } } diff --git a/Octokit/Clients/CommitCommentReactionsClient.cs b/Octokit/Clients/CommitCommentReactionsClient.cs index 3dca0f50..2b26250d 100644 --- a/Octokit/Clients/CommitCommentReactionsClient.cs +++ b/Octokit/Clients/CommitCommentReactionsClient.cs @@ -34,6 +34,21 @@ namespace Octokit return ApiConnection.Post(ApiUrls.CommitCommentReactions(owner, name, number), reaction, AcceptHeaders.ReactionsPreview); } + /// + /// Creates a reaction for a specified Commit Comment + /// + /// https://developer.github.com/v3/reactions/#create-reaction-for-a-commit-comment + /// The owner of the repository + /// The comment id + /// The reaction to create + /// A representing created reaction for specified comment id. + public Task Create(int repositoryId, int number, NewReaction reaction) + { + Ensure.ArgumentNotNull(reaction, "reaction"); + + return ApiConnection.Post(ApiUrls.CommitCommentReactions(repositoryId, number), reaction, AcceptHeaders.ReactionsPreview); + } + /// /// Get all reactions for a specified Commit Comment /// @@ -49,5 +64,17 @@ namespace Octokit return ApiConnection.GetAll(ApiUrls.CommitCommentReactions(owner, name, number), AcceptHeaders.ReactionsPreview); } + + /// + /// Get all reactions for a specified Commit Comment + /// + /// https://developer.github.com/v3/reactions/#list-reactions-for-a-commit-comment + /// The owner of the repository + /// The comment id + /// A of s representing all reactions for specified comment id. + public Task> GetAll(int repositoryId, int number) + { + return ApiConnection.GetAll(ApiUrls.CommitCommentReactions(repositoryId, number), AcceptHeaders.ReactionsPreview); + } } } diff --git a/Octokit/Clients/ICommitCommentReactionsClient.cs b/Octokit/Clients/ICommitCommentReactionsClient.cs index 5bc0a0fa..f5c64833 100644 --- a/Octokit/Clients/ICommitCommentReactionsClient.cs +++ b/Octokit/Clients/ICommitCommentReactionsClient.cs @@ -22,6 +22,16 @@ namespace Octokit /// A representing created reaction for specified comment id. Task Create(string owner, string name, int number, NewReaction reaction); + /// + /// Creates a reaction for a specified Commit Comment + /// + /// https://developer.github.com/v3/reactions/#create-reaction-for-a-commit-comment + /// The owner of the repository + /// The comment id + /// The reaction to create + /// A representing created reaction for specified comment id. + Task Create(int repositoryId, int number, NewReaction reaction); + /// /// Get all reactions for a specified Commit Comment /// @@ -31,5 +41,14 @@ namespace Octokit /// The comment id /// A of s representing all reactions for specified comment id. Task> GetAll(string owner, string name, int number); + + /// + /// Get all reactions for a specified Commit Comment + /// + /// https://developer.github.com/v3/reactions/#list-reactions-for-a-commit-comment + /// The owner of the repository + /// The comment id + /// A of s representing all reactions for specified comment id. + Task> GetAll(int repositoryId, int number); } } From 1b3f678831544b00f4e24dc2eb29a6ef53fe1a2f Mon Sep 17 00:00:00 2001 From: "aedampir@gmail.com" Date: Wed, 15 Jun 2016 15:49:18 +0700 Subject: [PATCH 04/12] fix api url --- Octokit/Helpers/ApiUrls.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Octokit/Helpers/ApiUrls.cs b/Octokit/Helpers/ApiUrls.cs index d7fc6aee..5f54c63f 100644 --- a/Octokit/Helpers/ApiUrls.cs +++ b/Octokit/Helpers/ApiUrls.cs @@ -432,7 +432,7 @@ namespace Octokit /// public static Uri CommitCommentReactions(int repositoryId, int number) { - return "repositories/{0}/comments/{2}/reactions".FormatUri(repositoryId, number); + return "repositories/{0}/comments/{1}/reactions".FormatUri(repositoryId, number); } /// From 52de7142801bdec85d8748162abb0ed06fa17c1b Mon Sep 17 00:00:00 2001 From: "aedampir@gmail.com" Date: Wed, 15 Jun 2016 15:56:32 +0700 Subject: [PATCH 05/12] added new unit tests --- .../CommitCommentReactionsClientTests.cs | 56 ++++++++++++-- ...rvableCommitCommentReactionsClientTests.cs | 73 ++++++++++++++----- 2 files changed, 102 insertions(+), 27 deletions(-) diff --git a/Octokit.Tests/Clients/CommitCommentReactionsClientTests.cs b/Octokit.Tests/Clients/CommitCommentReactionsClientTests.cs index aba818ca..4d5429ea 100644 --- a/Octokit.Tests/Clients/CommitCommentReactionsClientTests.cs +++ b/Octokit.Tests/Clients/CommitCommentReactionsClientTests.cs @@ -1,6 +1,6 @@ -using NSubstitute; -using System; +using System; using System.Threading.Tasks; +using NSubstitute; using Xunit; namespace Octokit.Tests.Clients @@ -30,16 +30,27 @@ namespace Octokit.Tests.Clients } [Fact] - public async Task EnsuresArgumentsNotNull() + public async Task RequestsCorrectUrlWithRepositoryId() { var connection = Substitute.For(); var client = new ReactionsClient(connection); - await Assert.ThrowsAsync(() => client.CommitComment.Create(null, "name", 1, new NewReaction(ReactionType.Heart))); - await Assert.ThrowsAsync(() => client.CommitComment.Create("", "name", 1, new NewReaction(ReactionType.Heart))); - await Assert.ThrowsAsync(() => client.CommitComment.Create("owner", null, 1, new NewReaction(ReactionType.Heart))); - await Assert.ThrowsAsync(() => client.CommitComment.Create("owner", "", 1, new NewReaction(ReactionType.Heart))); - await Assert.ThrowsAsync(() => client.CommitComment.Create("owner", "name", 1, null)); + client.CommitComment.GetAll(1, 42); + + connection.Received().GetAll(Arg.Is(u => u.ToString() == "repositories/1/comments/42/reactions"), "application/vnd.github.squirrel-girl-preview"); + } + + [Fact] + public async Task EnsuresNotNullArguments() + { + var connection = Substitute.For(); + var client = new ReactionsClient(connection); + + await Assert.ThrowsAsync(() => client.CommitComment.GetAll(null, "name", 1)); + await Assert.ThrowsAsync(() => client.CommitComment.GetAll("owner", null, 1)); + + await Assert.ThrowsAsync(() => client.CommitComment.GetAll("", "name", 1)); + await Assert.ThrowsAsync(() => client.CommitComment.GetAll("owner", "", 1)); } } @@ -57,6 +68,35 @@ namespace Octokit.Tests.Clients connection.Received().Post(Arg.Is(u => u.ToString() == "repos/fake/repo/comments/1/reactions"), Arg.Any(), "application/vnd.github.squirrel-girl-preview"); } + + [Fact] + public void RequestsCorrectUrlWithRepositoryId() + { + NewReaction newReaction = new NewReaction(ReactionType.Heart); + + var connection = Substitute.For(); + var client = new ReactionsClient(connection); + + client.CommitComment.Create(1, 1, newReaction); + + connection.Received().Post(Arg.Is(u => u.ToString() == "repositories/1/comments/1/reactions"), Arg.Any(), "application/vnd.github.squirrel-girl-preview"); + } + + [Fact] + public async Task EnsuresNotNullArguments() + { + var connection = Substitute.For(); + var client = new ReactionsClient(connection); + + await Assert.ThrowsAsync(() => client.CommitComment.Create(null, "name", 1, new NewReaction(ReactionType.Heart))); + await Assert.ThrowsAsync(() => client.CommitComment.Create("owner", null, 1, new NewReaction(ReactionType.Heart))); + await Assert.ThrowsAsync(() => client.CommitComment.Create("owner", "name", 1, null)); + + await Assert.ThrowsAsync(() => client.CommitComment.Create(1, 1, null)); + + await Assert.ThrowsAsync(() => client.CommitComment.Create("", "name", 1, new NewReaction(ReactionType.Heart))); + await Assert.ThrowsAsync(() => client.CommitComment.Create("owner", "", 1, new NewReaction(ReactionType.Heart))); + } } } } diff --git a/Octokit.Tests/Reactive/ObservableCommitCommentReactionsClientTests.cs b/Octokit.Tests/Reactive/ObservableCommitCommentReactionsClientTests.cs index 221d950f..67aa23d7 100644 --- a/Octokit.Tests/Reactive/ObservableCommitCommentReactionsClientTests.cs +++ b/Octokit.Tests/Reactive/ObservableCommitCommentReactionsClientTests.cs @@ -18,33 +18,39 @@ namespace Octokit.Tests.Reactive public class TheGetAllMethod { - private readonly IGitHubClient _githubClient; - private readonly IObservableReactionsClient _client; - private const string owner = "owner"; - private const string name = "name"; - - public TheGetAllMethod() - { - _githubClient = Substitute.For(); - _client = new ObservableReactionsClient(_githubClient); - } - [Fact] public void RequestsCorrectUrl() { - _client.CommitComment.GetAll("fake", "repo", 42); - _githubClient.Received().Reaction.CommitComment.GetAll("fake", "repo", 42); + var gitHubClient = Substitute.For(); + var client = new ObservableReactionsClient(gitHubClient); + + client.CommitComment.GetAll("fake", "repo", 42); + + gitHubClient.Received().Reaction.CommitComment.GetAll("fake", "repo", 42); } [Fact] - public void EnsuresArgumentsNotNull() + public void RequestsCorrectUrlWithRepositoryId() { + var gitHubClient = Substitute.For(); + var client = new ObservableReactionsClient(gitHubClient); - Assert.Throws(() => _client.CommitComment.Create(null, "name", 1, new NewReaction(ReactionType.Heart))); - Assert.Throws(() => _client.CommitComment.Create("", "name", 1, new NewReaction(ReactionType.Heart))); - Assert.Throws(() => _client.CommitComment.Create("owner", null, 1, new NewReaction(ReactionType.Heart))); - Assert.Throws(() => _client.CommitComment.Create("owner", "", 1, new NewReaction(ReactionType.Heart))); - Assert.Throws(() => _client.CommitComment.Create("owner", "name", 1, null)); + client.CommitComment.GetAll(1, 42); + + gitHubClient.Received().Reaction.CommitComment.GetAll(1, 42); + } + + [Fact] + public void EnsuresNotNullArguments() + { + var gitHubClient = Substitute.For(); + var client = new ObservableReactionsClient(gitHubClient); + + Assert.Throws(() => client.CommitComment.GetAll(null, "name", 1)); + Assert.Throws(() => client.CommitComment.GetAll("owner", null, 1)); + + Assert.Throws(() => client.CommitComment.GetAll("", "name", 1)); + Assert.Throws(() => client.CommitComment.GetAll("owner", "", 1)); } } @@ -58,8 +64,37 @@ namespace Octokit.Tests.Reactive var newReaction = new NewReaction(ReactionType.Confused); client.CommitComment.Create("fake", "repo", 1, newReaction); + githubClient.Received().Reaction.CommitComment.Create("fake", "repo", 1, newReaction); } + + [Fact] + public void RequestsCorrectUrlWithRepositoryId() + { + var githubClient = Substitute.For(); + var client = new ObservableReactionsClient(githubClient); + var newReaction = new NewReaction(ReactionType.Confused); + + client.CommitComment.Create(1, 1, newReaction); + + githubClient.Received().Reaction.CommitComment.Create(1, 1, newReaction); + } + + [Fact] + public void EnsuresNotNullArguments() + { + var gitHubClient = Substitute.For(); + var client = new ObservableReactionsClient(gitHubClient); + + Assert.Throws(() => client.CommitComment.Create(null, "name", 1, new NewReaction(ReactionType.Heart))); + Assert.Throws(() => client.CommitComment.Create("owner", null, 1, new NewReaction(ReactionType.Heart))); + Assert.Throws(() => client.CommitComment.Create("owner", "name", 1, null)); + + Assert.Throws(() => client.CommitComment.Create(1, 1, null)); + + Assert.Throws(() => client.CommitComment.Create("", "name", 1, new NewReaction(ReactionType.Heart))); + Assert.Throws(() => client.CommitComment.Create("owner", "", 1, new NewReaction(ReactionType.Heart))); + } } } } From b7f52d6c27cb44caf2cc1382895937bb54445bf0 Mon Sep 17 00:00:00 2001 From: "aedampir@gmail.com" Date: Wed, 15 Jun 2016 16:05:32 +0700 Subject: [PATCH 06/12] added integration tests --- .../CommitCommentReactionsClientTests.cs | 75 ++++++++++++++++++- 1 file changed, 72 insertions(+), 3 deletions(-) diff --git a/Octokit.Tests.Integration/Clients/CommitCommentReactionsClientTests.cs b/Octokit.Tests.Integration/Clients/CommitCommentReactionsClientTests.cs index 14e749b6..15508d52 100644 --- a/Octokit.Tests.Integration/Clients/CommitCommentReactionsClientTests.cs +++ b/Octokit.Tests.Integration/Clients/CommitCommentReactionsClientTests.cs @@ -1,8 +1,9 @@ -using Octokit; +using System; +using System.Linq; +using System.Threading.Tasks; +using Octokit; using Octokit.Tests.Integration; using Octokit.Tests.Integration.Helpers; -using System; -using System.Threading.Tasks; using Xunit; public class CommitCommentReactionsClientTests @@ -44,6 +45,52 @@ public class CommitCommentReactionsClientTests return await client.Git.Commit.Create(_context.RepositoryOwner, _context.RepositoryName, newCommit); } + [IntegrationTest] + public async Task CanListReactions() + { + var commit = await SetupCommitForRepository(_github); + + var comment = new NewCommitComment("test"); + + var result = await _github.Repository.Comment.Create(_context.RepositoryOwner, _context.RepositoryName, + commit.Sha, comment); + + Assert.NotNull(result); + + var newReaction = new NewReaction(ReactionType.Confused); + var reaction = await _github.Reaction.CommitComment.Create(_context.RepositoryOwner, _context.RepositoryName, result.Id, newReaction); + + var reactions = await _github.Reaction.CommitComment.GetAll(_context.RepositoryOwner, _context.RepositoryName, result.Id); + + Assert.NotEmpty(reactions); + + var @default = reactions.FirstOrDefault(r => r.Id == reaction.Id); + Assert.NotNull(@default); + } + + [IntegrationTest] + public async Task CanListReactionsWithRepositoryId() + { + var commit = await SetupCommitForRepository(_github); + + var comment = new NewCommitComment("test"); + + var result = await _github.Repository.Comment.Create(_context.RepositoryOwner, _context.RepositoryName, + commit.Sha, comment); + + Assert.NotNull(result); + + var newReaction = new NewReaction(ReactionType.Confused); + var reaction = await _github.Reaction.CommitComment.Create(_context.Repository.Id, result.Id, newReaction); + + var reactions = await _github.Reaction.CommitComment.GetAll(_context.Repository.Id, result.Id); + + Assert.NotEmpty(reactions); + + var @default = reactions.FirstOrDefault(r => r.Id == reaction.Id); + Assert.NotNull(@default); + } + [IntegrationTest] public async Task CanCreateReaction() { @@ -66,6 +113,28 @@ public class CommitCommentReactionsClientTests Assert.Equal(result.User.Id, reaction.User.Id); } + [IntegrationTest] + public async Task CanCreateReactionWithRepositoryId() + { + var commit = await SetupCommitForRepository(_github); + + var comment = new NewCommitComment("test"); + + var result = await _github.Repository.Comment.Create(_context.RepositoryOwner, _context.RepositoryName, + commit.Sha, comment); + + Assert.NotNull(result); + + var newReaction = new NewReaction(ReactionType.Confused); + var reaction = await _github.Reaction.CommitComment.Create(_context.Repository.Id, result.Id, newReaction); + + Assert.IsType(reaction); + + Assert.Equal(ReactionType.Confused, reaction.Content); + + Assert.Equal(result.User.Id, reaction.User.Id); + } + public void Dispose() { _context.Dispose(); From da6ad0371a3e250634a980aa72a2b0804c4605b1 Mon Sep 17 00:00:00 2001 From: "aedampir@gmail.com" Date: Wed, 15 Jun 2016 16:32:03 +0700 Subject: [PATCH 07/12] refactored unit tests --- .../CommitCommentReactionsClientTests.cs | 40 +++++++++---------- ...rvableCommitCommentReactionsClientTests.cs | 40 +++++++++---------- 2 files changed, 40 insertions(+), 40 deletions(-) diff --git a/Octokit.Tests/Clients/CommitCommentReactionsClientTests.cs b/Octokit.Tests/Clients/CommitCommentReactionsClientTests.cs index 4d5429ea..72bf0b66 100644 --- a/Octokit.Tests/Clients/CommitCommentReactionsClientTests.cs +++ b/Octokit.Tests/Clients/CommitCommentReactionsClientTests.cs @@ -22,9 +22,9 @@ namespace Octokit.Tests.Clients public async Task RequestsCorrectUrl() { var connection = Substitute.For(); - var client = new ReactionsClient(connection); + var client = new CommitCommentReactionsClient(connection); - client.CommitComment.GetAll("fake", "repo", 42); + client.GetAll("fake", "repo", 42); connection.Received().GetAll(Arg.Is(u => u.ToString() == "repos/fake/repo/comments/42/reactions"), "application/vnd.github.squirrel-girl-preview"); } @@ -33,9 +33,9 @@ namespace Octokit.Tests.Clients public async Task RequestsCorrectUrlWithRepositoryId() { var connection = Substitute.For(); - var client = new ReactionsClient(connection); + var client = new CommitCommentReactionsClient(connection); - client.CommitComment.GetAll(1, 42); + client.GetAll(1, 42); connection.Received().GetAll(Arg.Is(u => u.ToString() == "repositories/1/comments/42/reactions"), "application/vnd.github.squirrel-girl-preview"); } @@ -44,13 +44,13 @@ namespace Octokit.Tests.Clients public async Task EnsuresNotNullArguments() { var connection = Substitute.For(); - var client = new ReactionsClient(connection); + var client = new CommitCommentReactionsClient(connection); - await Assert.ThrowsAsync(() => client.CommitComment.GetAll(null, "name", 1)); - await Assert.ThrowsAsync(() => client.CommitComment.GetAll("owner", null, 1)); + await Assert.ThrowsAsync(() => client.GetAll(null, "name", 1)); + await Assert.ThrowsAsync(() => client.GetAll("owner", null, 1)); - await Assert.ThrowsAsync(() => client.CommitComment.GetAll("", "name", 1)); - await Assert.ThrowsAsync(() => client.CommitComment.GetAll("owner", "", 1)); + await Assert.ThrowsAsync(() => client.GetAll("", "name", 1)); + await Assert.ThrowsAsync(() => client.GetAll("owner", "", 1)); } } @@ -62,9 +62,9 @@ namespace Octokit.Tests.Clients NewReaction newReaction = new NewReaction(ReactionType.Heart); var connection = Substitute.For(); - var client = new ReactionsClient(connection); + var client = new CommitCommentReactionsClient(connection); - client.CommitComment.Create("fake", "repo", 1, newReaction); + client.Create("fake", "repo", 1, newReaction); connection.Received().Post(Arg.Is(u => u.ToString() == "repos/fake/repo/comments/1/reactions"), Arg.Any(), "application/vnd.github.squirrel-girl-preview"); } @@ -75,9 +75,9 @@ namespace Octokit.Tests.Clients NewReaction newReaction = new NewReaction(ReactionType.Heart); var connection = Substitute.For(); - var client = new ReactionsClient(connection); + var client = new CommitCommentReactionsClient(connection); - client.CommitComment.Create(1, 1, newReaction); + client.Create(1, 1, newReaction); connection.Received().Post(Arg.Is(u => u.ToString() == "repositories/1/comments/1/reactions"), Arg.Any(), "application/vnd.github.squirrel-girl-preview"); } @@ -86,16 +86,16 @@ namespace Octokit.Tests.Clients public async Task EnsuresNotNullArguments() { var connection = Substitute.For(); - var client = new ReactionsClient(connection); + var client = new CommitCommentReactionsClient(connection); - await Assert.ThrowsAsync(() => client.CommitComment.Create(null, "name", 1, new NewReaction(ReactionType.Heart))); - await Assert.ThrowsAsync(() => client.CommitComment.Create("owner", null, 1, new NewReaction(ReactionType.Heart))); - await Assert.ThrowsAsync(() => client.CommitComment.Create("owner", "name", 1, null)); + await Assert.ThrowsAsync(() => client.Create(null, "name", 1, new NewReaction(ReactionType.Heart))); + await Assert.ThrowsAsync(() => client.Create("owner", null, 1, new NewReaction(ReactionType.Heart))); + await Assert.ThrowsAsync(() => client.Create("owner", "name", 1, null)); - await Assert.ThrowsAsync(() => client.CommitComment.Create(1, 1, null)); + await Assert.ThrowsAsync(() => client.Create(1, 1, null)); - await Assert.ThrowsAsync(() => client.CommitComment.Create("", "name", 1, new NewReaction(ReactionType.Heart))); - await Assert.ThrowsAsync(() => client.CommitComment.Create("owner", "", 1, new NewReaction(ReactionType.Heart))); + await Assert.ThrowsAsync(() => client.Create("", "name", 1, new NewReaction(ReactionType.Heart))); + await Assert.ThrowsAsync(() => client.Create("owner", "", 1, new NewReaction(ReactionType.Heart))); } } } diff --git a/Octokit.Tests/Reactive/ObservableCommitCommentReactionsClientTests.cs b/Octokit.Tests/Reactive/ObservableCommitCommentReactionsClientTests.cs index 67aa23d7..021e9f24 100644 --- a/Octokit.Tests/Reactive/ObservableCommitCommentReactionsClientTests.cs +++ b/Octokit.Tests/Reactive/ObservableCommitCommentReactionsClientTests.cs @@ -22,9 +22,9 @@ namespace Octokit.Tests.Reactive public void RequestsCorrectUrl() { var gitHubClient = Substitute.For(); - var client = new ObservableReactionsClient(gitHubClient); + var client = new ObservableCommitCommentReactionsClient(gitHubClient); - client.CommitComment.GetAll("fake", "repo", 42); + client.GetAll("fake", "repo", 42); gitHubClient.Received().Reaction.CommitComment.GetAll("fake", "repo", 42); } @@ -33,9 +33,9 @@ namespace Octokit.Tests.Reactive public void RequestsCorrectUrlWithRepositoryId() { var gitHubClient = Substitute.For(); - var client = new ObservableReactionsClient(gitHubClient); + var client = new ObservableCommitCommentReactionsClient(gitHubClient); - client.CommitComment.GetAll(1, 42); + client.GetAll(1, 42); gitHubClient.Received().Reaction.CommitComment.GetAll(1, 42); } @@ -44,13 +44,13 @@ namespace Octokit.Tests.Reactive public void EnsuresNotNullArguments() { var gitHubClient = Substitute.For(); - var client = new ObservableReactionsClient(gitHubClient); + var client = new ObservableCommitCommentReactionsClient(gitHubClient); - Assert.Throws(() => client.CommitComment.GetAll(null, "name", 1)); - Assert.Throws(() => client.CommitComment.GetAll("owner", null, 1)); + Assert.Throws(() => client.GetAll(null, "name", 1)); + Assert.Throws(() => client.GetAll("owner", null, 1)); - Assert.Throws(() => client.CommitComment.GetAll("", "name", 1)); - Assert.Throws(() => client.CommitComment.GetAll("owner", "", 1)); + Assert.Throws(() => client.GetAll("", "name", 1)); + Assert.Throws(() => client.GetAll("owner", "", 1)); } } @@ -60,10 +60,10 @@ namespace Octokit.Tests.Reactive public void RequestsCorrectUrl() { var githubClient = Substitute.For(); - var client = new ObservableReactionsClient(githubClient); + var client = new ObservableCommitCommentReactionsClient(githubClient); var newReaction = new NewReaction(ReactionType.Confused); - client.CommitComment.Create("fake", "repo", 1, newReaction); + client.Create("fake", "repo", 1, newReaction); githubClient.Received().Reaction.CommitComment.Create("fake", "repo", 1, newReaction); } @@ -72,10 +72,10 @@ namespace Octokit.Tests.Reactive public void RequestsCorrectUrlWithRepositoryId() { var githubClient = Substitute.For(); - var client = new ObservableReactionsClient(githubClient); + var client = new ObservableCommitCommentReactionsClient(githubClient); var newReaction = new NewReaction(ReactionType.Confused); - client.CommitComment.Create(1, 1, newReaction); + client.Create(1, 1, newReaction); githubClient.Received().Reaction.CommitComment.Create(1, 1, newReaction); } @@ -84,16 +84,16 @@ namespace Octokit.Tests.Reactive public void EnsuresNotNullArguments() { var gitHubClient = Substitute.For(); - var client = new ObservableReactionsClient(gitHubClient); + var client = new ObservableCommitCommentReactionsClient(gitHubClient); - Assert.Throws(() => client.CommitComment.Create(null, "name", 1, new NewReaction(ReactionType.Heart))); - Assert.Throws(() => client.CommitComment.Create("owner", null, 1, new NewReaction(ReactionType.Heart))); - Assert.Throws(() => client.CommitComment.Create("owner", "name", 1, null)); + Assert.Throws(() => client.Create(null, "name", 1, new NewReaction(ReactionType.Heart))); + Assert.Throws(() => client.Create("owner", null, 1, new NewReaction(ReactionType.Heart))); + Assert.Throws(() => client.Create("owner", "name", 1, null)); - Assert.Throws(() => client.CommitComment.Create(1, 1, null)); + Assert.Throws(() => client.Create(1, 1, null)); - Assert.Throws(() => client.CommitComment.Create("", "name", 1, new NewReaction(ReactionType.Heart))); - Assert.Throws(() => client.CommitComment.Create("owner", "", 1, new NewReaction(ReactionType.Heart))); + Assert.Throws(() => client.Create("", "name", 1, new NewReaction(ReactionType.Heart))); + Assert.Throws(() => client.Create("owner", "", 1, new NewReaction(ReactionType.Heart))); } } } From b66aad0a83a47e90132777247019f558af9c8833 Mon Sep 17 00:00:00 2001 From: "aedampir@gmail.com" Date: Wed, 15 Jun 2016 16:41:13 +0700 Subject: [PATCH 08/12] modified XML docs --- .../Clients/IObservableCommitCommentReactionsClient.cs | 8 ++++---- .../Clients/ObservableCommitCommentReactionsClient.cs | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Octokit.Reactive/Clients/IObservableCommitCommentReactionsClient.cs b/Octokit.Reactive/Clients/IObservableCommitCommentReactionsClient.cs index 9411e675..751f76c5 100644 --- a/Octokit.Reactive/Clients/IObservableCommitCommentReactionsClient.cs +++ b/Octokit.Reactive/Clients/IObservableCommitCommentReactionsClient.cs @@ -18,7 +18,7 @@ namespace Octokit.Reactive /// The name of the repository /// The comment id /// The reaction to create - /// A of representing created reaction for specified comment id. + /// An of representing created reaction for specified comment id. IObservable Create(string owner, string name, int number, NewReaction reaction); /// @@ -28,7 +28,7 @@ namespace Octokit.Reactive /// The ID of the repository /// The comment id /// The reaction to create - /// A of representing created reaction for specified comment id. + /// An of representing created reaction for specified comment id. IObservable Create(int repositoryId, int number, NewReaction reaction); /// @@ -38,7 +38,7 @@ namespace Octokit.Reactive /// The owner of the repository /// The name of the repository /// The comment id - /// A of s representing all reactions for specified comment id. + /// An of s representing all reactions for specified comment id. IObservable GetAll(string owner, string name, int number); /// @@ -47,7 +47,7 @@ namespace Octokit.Reactive /// https://developer.github.com/v3/reactions/#list-reactions-for-a-commit-comment /// The owner of the repository /// The comment id - /// A of s representing all reactions for specified comment id. + /// An of s representing all reactions for specified comment id. IObservable GetAll(int repositoryId, int number); } } diff --git a/Octokit.Reactive/Clients/ObservableCommitCommentReactionsClient.cs b/Octokit.Reactive/Clients/ObservableCommitCommentReactionsClient.cs index f1c6c053..6f2eb723 100644 --- a/Octokit.Reactive/Clients/ObservableCommitCommentReactionsClient.cs +++ b/Octokit.Reactive/Clients/ObservableCommitCommentReactionsClient.cs @@ -31,7 +31,7 @@ namespace Octokit.Reactive /// The name of the repository /// The comment id /// The reaction to create - /// A of representing created reaction for specified comment id. + /// An of representing created reaction for specified comment id. public IObservable Create(string owner, string name, int number, NewReaction reaction) { Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); @@ -48,7 +48,7 @@ namespace Octokit.Reactive /// The ID of the repository /// The comment id /// The reaction to create - /// A of representing created reaction for specified comment id. + /// An of representing created reaction for specified comment id. public IObservable Create(int repositoryId, int number, NewReaction reaction) { Ensure.ArgumentNotNull(reaction, "reaction"); @@ -63,7 +63,7 @@ namespace Octokit.Reactive /// The owner of the repository /// The name of the repository /// The comment id - /// A of s representing all reactions for specified comment id. + /// An of s representing all reactions for specified comment id. public IObservable GetAll(string owner, string name, int number) { Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); @@ -78,7 +78,7 @@ namespace Octokit.Reactive /// https://developer.github.com/v3/reactions/#list-reactions-for-a-commit-comment /// The owner of the repository /// The comment id - /// A of s representing all reactions for specified comment id. + /// An of s representing all reactions for specified comment id. public IObservable GetAll(int repositoryId, int number) { return _connection.GetAndFlattenAllPages(ApiUrls.CommitCommentReactions(repositoryId, number), null, AcceptHeaders.ReactionsPreview); From 296f845b2258b85a4fe0176e3a85578d9d241835 Mon Sep 17 00:00:00 2001 From: "aedampir@gmail.com" Date: Wed, 15 Jun 2016 16:48:19 +0700 Subject: [PATCH 09/12] modified integration tests --- .../Clients/CommitCommentReactionsClientTests.cs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Octokit.Tests.Integration/Clients/CommitCommentReactionsClientTests.cs b/Octokit.Tests.Integration/Clients/CommitCommentReactionsClientTests.cs index 15508d52..2b15c4c5 100644 --- a/Octokit.Tests.Integration/Clients/CommitCommentReactionsClientTests.cs +++ b/Octokit.Tests.Integration/Clients/CommitCommentReactionsClientTests.cs @@ -1,5 +1,4 @@ using System; -using System.Linq; using System.Threading.Tasks; using Octokit; using Octokit.Tests.Integration; @@ -64,8 +63,9 @@ public class CommitCommentReactionsClientTests Assert.NotEmpty(reactions); - var @default = reactions.FirstOrDefault(r => r.Id == reaction.Id); - Assert.NotNull(@default); + Assert.Equal(reaction.Id, reactions[0].Id); + + Assert.Equal(reaction.Content, reactions[0].Content); } [IntegrationTest] @@ -87,8 +87,9 @@ public class CommitCommentReactionsClientTests Assert.NotEmpty(reactions); - var @default = reactions.FirstOrDefault(r => r.Id == reaction.Id); - Assert.NotNull(@default); + Assert.Equal(reaction.Id, reactions[0].Id); + + Assert.Equal(reaction.Content, reactions[0].Content); } [IntegrationTest] From ee2c94000016780aab80af4815d43155e0dde478 Mon Sep 17 00:00:00 2001 From: "aedampir@gmail.com" Date: Wed, 15 Jun 2016 18:07:50 +0700 Subject: [PATCH 10/12] added awaits --- Octokit.Tests/Clients/CommitCommentReactionsClientTests.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Octokit.Tests/Clients/CommitCommentReactionsClientTests.cs b/Octokit.Tests/Clients/CommitCommentReactionsClientTests.cs index 72bf0b66..519d207d 100644 --- a/Octokit.Tests/Clients/CommitCommentReactionsClientTests.cs +++ b/Octokit.Tests/Clients/CommitCommentReactionsClientTests.cs @@ -24,7 +24,7 @@ namespace Octokit.Tests.Clients var connection = Substitute.For(); var client = new CommitCommentReactionsClient(connection); - client.GetAll("fake", "repo", 42); + await client.GetAll("fake", "repo", 42); connection.Received().GetAll(Arg.Is(u => u.ToString() == "repos/fake/repo/comments/42/reactions"), "application/vnd.github.squirrel-girl-preview"); } @@ -35,7 +35,7 @@ namespace Octokit.Tests.Clients var connection = Substitute.For(); var client = new CommitCommentReactionsClient(connection); - client.GetAll(1, 42); + await client.GetAll(1, 42); connection.Received().GetAll(Arg.Is(u => u.ToString() == "repositories/1/comments/42/reactions"), "application/vnd.github.squirrel-girl-preview"); } From 240b8328ccb8f3f9dc85fc472a536f81df6dfb6d Mon Sep 17 00:00:00 2001 From: "aedampir@gmail.com" Date: Wed, 15 Jun 2016 18:56:37 +0700 Subject: [PATCH 11/12] modified unit tests --- Octokit.Tests/Clients/CommitCommentReactionsClientTests.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Octokit.Tests/Clients/CommitCommentReactionsClientTests.cs b/Octokit.Tests/Clients/CommitCommentReactionsClientTests.cs index 519d207d..0f55c0e8 100644 --- a/Octokit.Tests/Clients/CommitCommentReactionsClientTests.cs +++ b/Octokit.Tests/Clients/CommitCommentReactionsClientTests.cs @@ -66,7 +66,7 @@ namespace Octokit.Tests.Clients client.Create("fake", "repo", 1, newReaction); - connection.Received().Post(Arg.Is(u => u.ToString() == "repos/fake/repo/comments/1/reactions"), Arg.Any(), "application/vnd.github.squirrel-girl-preview"); + connection.Received().Post(Arg.Is(u => u.ToString() == "repos/fake/repo/comments/1/reactions"), newReaction, "application/vnd.github.squirrel-girl-preview"); } [Fact] @@ -79,7 +79,7 @@ namespace Octokit.Tests.Clients client.Create(1, 1, newReaction); - connection.Received().Post(Arg.Is(u => u.ToString() == "repositories/1/comments/1/reactions"), Arg.Any(), "application/vnd.github.squirrel-girl-preview"); + connection.Received().Post(Arg.Is(u => u.ToString() == "repositories/1/comments/1/reactions"), newReaction, "application/vnd.github.squirrel-girl-preview"); } [Fact] From c17a8b664bb3eddfa1f82e49186407f800de0b7c Mon Sep 17 00:00:00 2001 From: Alexander Efremov Date: Fri, 17 Jun 2016 06:05:45 +0700 Subject: [PATCH 12/12] cleared tags --- .../Clients/IObservableCommitCommentReactionsClient.cs | 8 ++++---- .../Clients/ObservableCommitCommentReactionsClient.cs | 8 ++++---- Octokit/Clients/CommitCommentReactionsClient.cs | 8 ++++---- Octokit/Clients/ICommitCommentReactionsClient.cs | 8 ++++---- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/Octokit.Reactive/Clients/IObservableCommitCommentReactionsClient.cs b/Octokit.Reactive/Clients/IObservableCommitCommentReactionsClient.cs index 751f76c5..5d837b70 100644 --- a/Octokit.Reactive/Clients/IObservableCommitCommentReactionsClient.cs +++ b/Octokit.Reactive/Clients/IObservableCommitCommentReactionsClient.cs @@ -18,7 +18,7 @@ namespace Octokit.Reactive /// The name of the repository /// The comment id /// The reaction to create - /// An of representing created reaction for specified comment id. + /// IObservable Create(string owner, string name, int number, NewReaction reaction); /// @@ -28,7 +28,7 @@ namespace Octokit.Reactive /// The ID of the repository /// The comment id /// The reaction to create - /// An of representing created reaction for specified comment id. + /// IObservable Create(int repositoryId, int number, NewReaction reaction); /// @@ -38,7 +38,7 @@ namespace Octokit.Reactive /// The owner of the repository /// The name of the repository /// The comment id - /// An of s representing all reactions for specified comment id. + /// IObservable GetAll(string owner, string name, int number); /// @@ -47,7 +47,7 @@ namespace Octokit.Reactive /// https://developer.github.com/v3/reactions/#list-reactions-for-a-commit-comment /// The owner of the repository /// The comment id - /// An of s representing all reactions for specified comment id. + /// IObservable GetAll(int repositoryId, int number); } } diff --git a/Octokit.Reactive/Clients/ObservableCommitCommentReactionsClient.cs b/Octokit.Reactive/Clients/ObservableCommitCommentReactionsClient.cs index 6f2eb723..7b138355 100644 --- a/Octokit.Reactive/Clients/ObservableCommitCommentReactionsClient.cs +++ b/Octokit.Reactive/Clients/ObservableCommitCommentReactionsClient.cs @@ -31,7 +31,7 @@ namespace Octokit.Reactive /// The name of the repository /// The comment id /// The reaction to create - /// An of representing created reaction for specified comment id. + /// public IObservable Create(string owner, string name, int number, NewReaction reaction) { Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); @@ -48,7 +48,7 @@ namespace Octokit.Reactive /// The ID of the repository /// The comment id /// The reaction to create - /// An of representing created reaction for specified comment id. + /// public IObservable Create(int repositoryId, int number, NewReaction reaction) { Ensure.ArgumentNotNull(reaction, "reaction"); @@ -63,7 +63,7 @@ namespace Octokit.Reactive /// The owner of the repository /// The name of the repository /// The comment id - /// An of s representing all reactions for specified comment id. + /// public IObservable GetAll(string owner, string name, int number) { Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); @@ -78,7 +78,7 @@ namespace Octokit.Reactive /// https://developer.github.com/v3/reactions/#list-reactions-for-a-commit-comment /// The owner of the repository /// The comment id - /// An of s representing all reactions for specified comment id. + /// public IObservable GetAll(int repositoryId, int number) { return _connection.GetAndFlattenAllPages(ApiUrls.CommitCommentReactions(repositoryId, number), null, AcceptHeaders.ReactionsPreview); diff --git a/Octokit/Clients/CommitCommentReactionsClient.cs b/Octokit/Clients/CommitCommentReactionsClient.cs index 2b26250d..34ff4edc 100644 --- a/Octokit/Clients/CommitCommentReactionsClient.cs +++ b/Octokit/Clients/CommitCommentReactionsClient.cs @@ -24,7 +24,7 @@ namespace Octokit /// The name of the repository /// The comment id /// The reaction to create - /// A representing created reaction for specified comment id. + /// public Task Create(string owner, string name, int number, NewReaction reaction) { Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); @@ -41,7 +41,7 @@ namespace Octokit /// The owner of the repository /// The comment id /// The reaction to create - /// A representing created reaction for specified comment id. + /// public Task Create(int repositoryId, int number, NewReaction reaction) { Ensure.ArgumentNotNull(reaction, "reaction"); @@ -56,7 +56,7 @@ namespace Octokit /// The owner of the repository /// The name of the repository /// The comment id - /// A of s representing all reactions for specified comment id. + /// public Task> GetAll(string owner, string name, int number) { Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); @@ -71,7 +71,7 @@ namespace Octokit /// https://developer.github.com/v3/reactions/#list-reactions-for-a-commit-comment /// The owner of the repository /// The comment id - /// A of s representing all reactions for specified comment id. + /// public Task> GetAll(int repositoryId, int number) { return ApiConnection.GetAll(ApiUrls.CommitCommentReactions(repositoryId, number), AcceptHeaders.ReactionsPreview); diff --git a/Octokit/Clients/ICommitCommentReactionsClient.cs b/Octokit/Clients/ICommitCommentReactionsClient.cs index f5c64833..241d4cce 100644 --- a/Octokit/Clients/ICommitCommentReactionsClient.cs +++ b/Octokit/Clients/ICommitCommentReactionsClient.cs @@ -19,7 +19,7 @@ namespace Octokit /// The name of the repository /// The comment id /// The reaction to create - /// A representing created reaction for specified comment id. + /// Task Create(string owner, string name, int number, NewReaction reaction); /// @@ -29,7 +29,7 @@ namespace Octokit /// The owner of the repository /// The comment id /// The reaction to create - /// A representing created reaction for specified comment id. + /// Task Create(int repositoryId, int number, NewReaction reaction); /// @@ -39,7 +39,7 @@ namespace Octokit /// The owner of the repository /// The name of the repository /// The comment id - /// A of s representing all reactions for specified comment id. + /// Task> GetAll(string owner, string name, int number); /// @@ -48,7 +48,7 @@ namespace Octokit /// https://developer.github.com/v3/reactions/#list-reactions-for-a-commit-comment /// The owner of the repository /// The comment id - /// A of s representing all reactions for specified comment id. + /// Task> GetAll(int repositoryId, int number); } }