diff --git a/Octokit.Reactive/Clients/IObservableRepositoryCommentsClient.cs b/Octokit.Reactive/Clients/IObservableRepositoryCommentsClient.cs
index 0883509d..24f01ff7 100644
--- a/Octokit.Reactive/Clients/IObservableRepositoryCommentsClient.cs
+++ b/Octokit.Reactive/Clients/IObservableRepositoryCommentsClient.cs
@@ -88,17 +88,6 @@ namespace Octokit.Reactive
/// The name of the repository
/// The comment id
///
- IObservable Delete(string owner, string name, int number);
-
- ///
- /// Creates a reaction for specified Commit Comment
- ///
- /// https://developer.github.com/v3/reactions/#create-reaction-for-a-commit-comment
- /// The owner of the repository
- /// The name of the repository
- /// The comment id
- /// The reaction to create
- ///
- IObservable CreateReaction(string owner, string name, int number, NewReaction reaction);
+ IObservable Delete(string owner, string name, int number);
}
}
diff --git a/Octokit.Reactive/Clients/ObservableCommitCommentReactionClient.cs b/Octokit.Reactive/Clients/ObservableCommitCommentReactionClient.cs
index 91f59d92..6b632fce 100644
--- a/Octokit.Reactive/Clients/ObservableCommitCommentReactionClient.cs
+++ b/Octokit.Reactive/Clients/ObservableCommitCommentReactionClient.cs
@@ -41,8 +41,7 @@ namespace Octokit.Reactive
/// http://developer.github.com/v3/repos/comments/#list-reactions-for-a-commit-comment
/// The owner of the repository
/// The name of the repository
- /// The comment id
- /// The reaction for
+ /// The comment id
///
public IObservable GetAll(string owner, string name, int number)
{
diff --git a/Octokit.Reactive/Clients/ObservableRepositoryCommentsClient.cs b/Octokit.Reactive/Clients/ObservableRepositoryCommentsClient.cs
index 44069915..3826850f 100644
--- a/Octokit.Reactive/Clients/ObservableRepositoryCommentsClient.cs
+++ b/Octokit.Reactive/Clients/ObservableRepositoryCommentsClient.cs
@@ -154,22 +154,5 @@ namespace Octokit.Reactive
return _client.Delete(owner, name, number).ToObservable();
}
-
- ///
- /// Creates a reaction for specified Commit Comment
- ///
- /// http://developer.github.com/v3/repos/comments/#create-reaction-for-a-commit-comment
- /// The owner of the repository
- /// The name of the repository
- /// The comment id
- /// The reaction for
- ///
- public IObservable CreateReaction(string owner, string name, int number, NewReaction reaction)
- {
- Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
- Ensure.ArgumentNotNullOrEmptyString(name, "name");
-
- return _client.CreateReaction(owner, name, number, reaction).ToObservable();
- }
}
}
diff --git a/Octokit.Tests.Integration/Clients/RepositoryCommentsClientTests.cs b/Octokit.Tests.Integration/Clients/RepositoryCommentsClientTests.cs
index f00b8d1c..c6a81129 100644
--- a/Octokit.Tests.Integration/Clients/RepositoryCommentsClientTests.cs
+++ b/Octokit.Tests.Integration/Clients/RepositoryCommentsClientTests.cs
@@ -377,68 +377,68 @@ public class RepositoryCommentsClientTests
}
}
- public class TheCreateReactionMethod : IDisposable
- {
- private readonly IGitHubClient _github;
- private readonly RepositoryContext _context;
+ //public class TheCreateReactionMethod : IDisposable
+ //{
+ // private readonly IGitHubClient _github;
+ // private readonly RepositoryContext _context;
- public TheCreateReactionMethod()
- {
- _github = Helper.GetAuthenticatedClient();
+ // public TheCreateReactionMethod()
+ // {
+ // _github = Helper.GetAuthenticatedClient();
- _context = _github.CreateRepositoryContext("public-repo").Result;
- }
+ // _context = _github.CreateRepositoryContext("public-repo").Result;
+ // }
- private async Task SetupCommitForRepository(IGitHubClient client)
- {
- var blob = new NewBlob
- {
- Content = "Hello World!",
- Encoding = EncodingType.Utf8
- };
- var blobResult = await client.Git.Blob.Create(_context.RepositoryOwner, _context.RepositoryName, blob);
+ // private async Task SetupCommitForRepository(IGitHubClient client)
+ // {
+ // var blob = new NewBlob
+ // {
+ // Content = "Hello World!",
+ // Encoding = EncodingType.Utf8
+ // };
+ // var blobResult = await client.Git.Blob.Create(_context.RepositoryOwner, _context.RepositoryName, blob);
- var newTree = new NewTree();
- newTree.Tree.Add(new NewTreeItem
- {
- Type = TreeType.Blob,
- Mode = FileMode.File,
- Path = "README.md",
- Sha = blobResult.Sha
- });
+ // var newTree = new NewTree();
+ // newTree.Tree.Add(new NewTreeItem
+ // {
+ // Type = TreeType.Blob,
+ // Mode = FileMode.File,
+ // Path = "README.md",
+ // Sha = blobResult.Sha
+ // });
- var treeResult = await client.Git.Tree.Create(_context.RepositoryOwner, _context.RepositoryName, newTree);
+ // var treeResult = await client.Git.Tree.Create(_context.RepositoryOwner, _context.RepositoryName, newTree);
- var newCommit = new NewCommit("test-commit", treeResult.Sha);
+ // var newCommit = new NewCommit("test-commit", treeResult.Sha);
- return await client.Git.Commit.Create(_context.RepositoryOwner, _context.RepositoryName, newCommit);
- }
+ // return await client.Git.Commit.Create(_context.RepositoryOwner, _context.RepositoryName, newCommit);
+ // }
- [IntegrationTest]
- public async Task CanCreateReaction()
- {
- var commit = await SetupCommitForRepository(_github);
+ // [IntegrationTest]
+ // public async Task CanCreateReaction()
+ // {
+ // var commit = await SetupCommitForRepository(_github);
- var comment = new NewCommitComment("test");
+ // var comment = new NewCommitComment("test");
- var result = await _github.Repository.Comment.Create(_context.RepositoryOwner, _context.RepositoryName,
- commit.Sha, comment);
+ // var result = await _github.Repository.Comment.Create(_context.RepositoryOwner, _context.RepositoryName,
+ // commit.Sha, comment);
- Assert.NotNull(result);
+ // Assert.NotNull(result);
- var newReaction = new NewReaction(ReactionType.Confused);
- var reaction = await _github.Repository.Comment.CreateReaction(_context.RepositoryOwner, _context.RepositoryName, result.Id, newReaction);
+ // var newReaction = new NewReaction(ReactionType.Confused);
+ // var reaction = await _github.Repository.Comment.CreateReaction(_context.RepositoryOwner, _context.RepositoryName, result.Id, newReaction);
- Assert.IsType(reaction);
+ // Assert.IsType(reaction);
- Assert.Equal(ReactionType.Confused, reaction.Content);
+ // Assert.Equal(ReactionType.Confused, reaction.Content);
- Assert.Equal(result.User.Id, reaction.UserId);
- }
+ // Assert.Equal(result.User.Id, reaction.UserId);
+ // }
- public void Dispose()
- {
- _context.Dispose();
- }
- }
+ // public void Dispose()
+ // {
+ // _context.Dispose();
+ // }
+ //}
}
diff --git a/Octokit.Tests/Clients/ReactionsClientTests.cs b/Octokit.Tests/Clients/ReactionsClientTests.cs
new file mode 100644
index 00000000..bfe37b3b
--- /dev/null
+++ b/Octokit.Tests/Clients/ReactionsClientTests.cs
@@ -0,0 +1,55 @@
+using NSubstitute;
+using Octokit;
+using Octokit.Tests;
+using System;
+using System.Threading.Tasks;
+using Xunit;
+
+public class ReactionsClientTests
+{
+ public class CommitComments
+ {
+ public class TheGetAllMethod
+ {
+ [Fact]
+ public async Task RequestsCorrectUrl()
+ {
+ var connection = Substitute.For();
+ var client = new ReactionsClient(connection);
+
+ client.CommitComments.GetAll("fake", "repo", 42);
+
+ connection.Received().GetAll(Arg.Is(u => u.ToString() == "repos/fake/repo/comments/1/reactions"), "application/vnd.github.squirrel-girl-preview");
+ }
+
+ [Fact]
+ public async Task EnsuresArgumentsNotNull()
+ {
+ var connection = Substitute.For();
+ var client = new ReactionsClient(connection);
+
+ await Assert.ThrowsAsync(() => client.CommitComments.CreateReaction(null, "name", 1, new NewReaction(ReactionType.Heart)));
+ await Assert.ThrowsAsync(() => client.CommitComments.CreateReaction("", "name", 1, new NewReaction(ReactionType.Heart)));
+ await Assert.ThrowsAsync(() => client.CommitComments.CreateReaction("owner", null, 1, new NewReaction(ReactionType.Heart)));
+ await Assert.ThrowsAsync(() => client.CommitComments.CreateReaction("owner", "", 1, new NewReaction(ReactionType.Heart)));
+ }
+ }
+
+ public class TheCreateMethod
+ {
+ [Fact]
+ public void RequestsCorrectUrl()
+ {
+ NewReaction newReaction = new NewReaction(ReactionType.Heart);
+
+ var connection = Substitute.For();
+ var client = new ReactionsClient(connection);
+
+ client.CommitComments.CreateReaction("fake", "repo", 1, newReaction);
+
+ connection.Received().Post(Arg.Is(u => u.ToString() == "repos/fake/repo/comments/1/reactions"), Arg.Any