diff --git a/Octokit.Reactive/Clients/IObservableRepositoryCommentsClient.cs b/Octokit.Reactive/Clients/IObservableRepositoryCommentsClient.cs index 8fb1be79..0883509d 100644 --- a/Octokit.Reactive/Clients/IObservableRepositoryCommentsClient.cs +++ b/Octokit.Reactive/Clients/IObservableRepositoryCommentsClient.cs @@ -99,6 +99,6 @@ namespace Octokit.Reactive /// The comment id /// The reaction to create /// - IObservable CreateReaction(string owner, string name, int number, NewCommitCommentReaction reaction); + IObservable CreateReaction(string owner, string name, int number, NewReaction reaction); } } diff --git a/Octokit.Reactive/Clients/ObservableRepositoryCommentsClient.cs b/Octokit.Reactive/Clients/ObservableRepositoryCommentsClient.cs index 2f8e74d4..44069915 100644 --- a/Octokit.Reactive/Clients/ObservableRepositoryCommentsClient.cs +++ b/Octokit.Reactive/Clients/ObservableRepositoryCommentsClient.cs @@ -164,7 +164,7 @@ namespace Octokit.Reactive /// The comment id /// The reaction for /// - public IObservable CreateReaction(string owner, string name, int number, NewCommitCommentReaction reaction) + public IObservable CreateReaction(string owner, string name, int number, NewReaction reaction) { Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); Ensure.ArgumentNotNullOrEmptyString(name, "name"); diff --git a/Octokit.Tests.Integration/Clients/RepositoryCommentsClientTests.cs b/Octokit.Tests.Integration/Clients/RepositoryCommentsClientTests.cs index 448c3043..70df5173 100644 --- a/Octokit.Tests.Integration/Clients/RepositoryCommentsClientTests.cs +++ b/Octokit.Tests.Integration/Clients/RepositoryCommentsClientTests.cs @@ -417,12 +417,12 @@ public class RepositoryCommentsClientTests Assert.NotNull(result); - var newCommitCommentReaction = new NewCommitCommentReaction(Reaction.Confused); - var reaction = await _github.Repository.Comment.CreateReaction(_context.RepositoryOwner, _context.RepositoryName, result.Id, newCommitCommentReaction); + var newReaction = new NewReaction(EnumReaction.Confused); + var reaction = await _github.Repository.Comment.CreateReaction(_context.RepositoryOwner, _context.RepositoryName, result.Id, newReaction); - Assert.IsType(reaction); + Assert.IsType(reaction); - Assert.Equal(Reaction.Confused, reaction.Content); + Assert.Equal(EnumReaction.Confused, reaction.Content); Assert.Equal(result.User.Id, reaction.UserId); } diff --git a/Octokit.Tests/Clients/RepositoryCommentsClientTests.cs b/Octokit.Tests/Clients/RepositoryCommentsClientTests.cs index dced43ed..0a0b6a7d 100644 --- a/Octokit.Tests/Clients/RepositoryCommentsClientTests.cs +++ b/Octokit.Tests/Clients/RepositoryCommentsClientTests.cs @@ -245,14 +245,14 @@ public class RepositoryCommentsClientTests [Fact] public void RequestsCorrectUrl() { - NewCommitCommentReaction newCommitCommentReaction = new NewCommitCommentReaction(Reaction.Heart); + NewReaction newReaction = new NewReaction(EnumReaction.Heart); var connection = Substitute.For(); var client = new RepositoryCommentsClient(connection); - client.CreateReaction("fake", "repo", 1, newCommitCommentReaction); + client.CreateReaction("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"), Arg.Any(), "application/vnd.github.squirrel-girl-preview"); } [Fact] @@ -261,10 +261,10 @@ public class RepositoryCommentsClientTests var connection = Substitute.For(); var client = new RepositoryCommentsClient(connection); - await Assert.ThrowsAsync(() => client.CreateReaction(null, "name", 1, new NewCommitCommentReaction(Reaction.Heart))); - await Assert.ThrowsAsync(() => client.CreateReaction("", "name", 1, new NewCommitCommentReaction(Reaction.Heart))); - await Assert.ThrowsAsync(() => client.CreateReaction("owner", null, 1, new NewCommitCommentReaction(Reaction.Heart))); - await Assert.ThrowsAsync(() => client.CreateReaction("owner", "", 1, new NewCommitCommentReaction(Reaction.Heart))); + await Assert.ThrowsAsync(() => client.CreateReaction(null, "name", 1, new NewReaction(EnumReaction.Heart))); + await Assert.ThrowsAsync(() => client.CreateReaction("", "name", 1, new NewReaction(EnumReaction.Heart))); + await Assert.ThrowsAsync(() => client.CreateReaction("owner", null, 1, new NewReaction(EnumReaction.Heart))); + await Assert.ThrowsAsync(() => client.CreateReaction("owner", "", 1, new NewReaction(EnumReaction.Heart))); } } diff --git a/Octokit.Tests/Reactive/ObservableRepositoryCommentsClientTests.cs b/Octokit.Tests/Reactive/ObservableRepositoryCommentsClientTests.cs index 76b27f85..1ac164cf 100644 --- a/Octokit.Tests/Reactive/ObservableRepositoryCommentsClientTests.cs +++ b/Octokit.Tests/Reactive/ObservableRepositoryCommentsClientTests.cs @@ -140,10 +140,10 @@ namespace Octokit.Tests.Reactive { var githubClient = Substitute.For(); var client = new ObservableRepositoryCommentsClient(githubClient); - var newCommitCommentReaction = new NewCommitCommentReaction(Reaction.Confused); + var newReaction = new NewReaction(EnumReaction.Confused); - client.CreateReaction("fake", "repo", 1, newCommitCommentReaction); - githubClient.Received().Repository.Comment.CreateReaction("fake", "repo", 1, newCommitCommentReaction); + client.CreateReaction("fake", "repo", 1, newReaction); + githubClient.Received().Repository.Comment.CreateReaction("fake", "repo", 1, newReaction); } [Fact] @@ -152,10 +152,10 @@ namespace Octokit.Tests.Reactive var githubClient = Substitute.For(); var client = new ObservableRepositoryCommentsClient(githubClient); - Assert.Throws(() => client.CreateReaction(null, "name", 1, new NewCommitCommentReaction(Reaction.Heart))); - Assert.Throws(() => client.CreateReaction("", "name", 1, new NewCommitCommentReaction(Reaction.Heart))); - Assert.Throws(() => client.CreateReaction("owner", null, 1, new NewCommitCommentReaction(Reaction.Heart))); - Assert.Throws(() => client.CreateReaction("owner", "", 1, new NewCommitCommentReaction(Reaction.Heart))); + Assert.Throws(() => client.CreateReaction(null, "name", 1, new NewReaction(EnumReaction.Heart))); + Assert.Throws(() => client.CreateReaction("", "name", 1, new NewReaction(EnumReaction.Heart))); + Assert.Throws(() => client.CreateReaction("owner", null, 1, new NewReaction(EnumReaction.Heart))); + Assert.Throws(() => client.CreateReaction("owner", "", 1, new NewReaction(EnumReaction.Heart))); } } } diff --git a/Octokit/Clients/IRepositoryCommentsClient.cs b/Octokit/Clients/IRepositoryCommentsClient.cs index a6bbcdbb..a32e5c61 100644 --- a/Octokit/Clients/IRepositoryCommentsClient.cs +++ b/Octokit/Clients/IRepositoryCommentsClient.cs @@ -105,6 +105,6 @@ namespace Octokit /// The comment id /// The reaction for /// - Task CreateReaction(string owner, string name, int number, NewCommitCommentReaction reaction); + Task CreateReaction(string owner, string name, int number, NewReaction reaction); } } diff --git a/Octokit/Clients/RepositoryCommentsClient.cs b/Octokit/Clients/RepositoryCommentsClient.cs index fdc2889b..f6a07b7e 100644 --- a/Octokit/Clients/RepositoryCommentsClient.cs +++ b/Octokit/Clients/RepositoryCommentsClient.cs @@ -166,13 +166,13 @@ namespace Octokit /// The comment id /// The reaction for /// - public Task CreateReaction(string owner, string name, int number, NewCommitCommentReaction reaction) + public Task CreateReaction(string owner, string name, int number, NewReaction reaction) { Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); Ensure.ArgumentNotNullOrEmptyString(name, "name"); Ensure.ArgumentNotNull(reaction, "reaction"); - return ApiConnection.Post(ApiUrls.CommitCommentReaction(owner, name, number), reaction, AcceptHeaders.ReactionsPreview); + return ApiConnection.Post(ApiUrls.CommitCommentReaction(owner, name, number), reaction, AcceptHeaders.ReactionsPreview); } } } diff --git a/Octokit/Models/Request/NewCommitCommentReaction.cs b/Octokit/Models/Request/NewReaction.cs similarity index 69% rename from Octokit/Models/Request/NewCommitCommentReaction.cs rename to Octokit/Models/Request/NewReaction.cs index 95b5cdf6..060f0df1 100644 --- a/Octokit/Models/Request/NewCommitCommentReaction.cs +++ b/Octokit/Models/Request/NewReaction.cs @@ -4,13 +4,13 @@ using System.Globalization; namespace Octokit { [DebuggerDisplay("{DebuggerDisplay,nq}")] - public class NewCommitCommentReaction + public class NewReaction { /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// The reaction type. - public NewCommitCommentReaction(Reaction content) + public NewReaction(EnumReaction content) { Content = content; } @@ -18,7 +18,7 @@ namespace Octokit /// /// The reaction type (required) /// - public Reaction Content { get; private set; } + public EnumReaction Content { get; private set; } internal string DebuggerDisplay { diff --git a/Octokit/Models/Response/CommitCommentReaction.cs b/Octokit/Models/Response/Reaction.cs similarity index 83% rename from Octokit/Models/Response/CommitCommentReaction.cs rename to Octokit/Models/Response/Reaction.cs index b4660715..92ec308d 100644 --- a/Octokit/Models/Response/CommitCommentReaction.cs +++ b/Octokit/Models/Response/Reaction.cs @@ -5,7 +5,7 @@ using System.Globalization; namespace Octokit { - public enum Reaction + public enum EnumReaction { [Parameter(Value = "+1")] Plus1, @@ -22,11 +22,11 @@ namespace Octokit } [DebuggerDisplay("{DebuggerDisplay,nq}")] - public class CommitCommentReaction + public class Reaction { - public CommitCommentReaction() { } + public Reaction() { } - public CommitCommentReaction(int id, int userId, Reaction content) + public Reaction(int id, int userId, EnumReaction content) { Id = id; UserId = userId; @@ -47,7 +47,7 @@ namespace Octokit /// The reaction type for this commit comment. /// [Parameter(Key = "content")] - public Reaction Content { get; protected set; } + public EnumReaction Content { get; protected set; } internal string DebuggerDisplay { diff --git a/Octokit/Octokit-Mono.csproj b/Octokit/Octokit-Mono.csproj index a5edbe20..e1d404be 100644 --- a/Octokit/Octokit-Mono.csproj +++ b/Octokit/Octokit-Mono.csproj @@ -466,8 +466,8 @@ - - + + \ No newline at end of file diff --git a/Octokit/Octokit-MonoAndroid.csproj b/Octokit/Octokit-MonoAndroid.csproj index 2bdf311f..88be5cf0 100644 --- a/Octokit/Octokit-MonoAndroid.csproj +++ b/Octokit/Octokit-MonoAndroid.csproj @@ -477,8 +477,8 @@ - - + + \ No newline at end of file diff --git a/Octokit/Octokit-Monotouch.csproj b/Octokit/Octokit-Monotouch.csproj index 4034868c..0b16601c 100644 --- a/Octokit/Octokit-Monotouch.csproj +++ b/Octokit/Octokit-Monotouch.csproj @@ -473,8 +473,8 @@ - - + + diff --git a/Octokit/Octokit-Portable.csproj b/Octokit/Octokit-Portable.csproj index fe318eab..ca97a4c6 100644 --- a/Octokit/Octokit-Portable.csproj +++ b/Octokit/Octokit-Portable.csproj @@ -462,9 +462,9 @@ - - - + + + diff --git a/Octokit/Octokit-netcore45.csproj b/Octokit/Octokit-netcore45.csproj index 358b1d74..16f76baf 100644 --- a/Octokit/Octokit-netcore45.csproj +++ b/Octokit/Octokit-netcore45.csproj @@ -469,9 +469,9 @@ - - - + + + diff --git a/Octokit/Octokit.csproj b/Octokit/Octokit.csproj index 6b59c108..00b0cfca 100644 --- a/Octokit/Octokit.csproj +++ b/Octokit/Octokit.csproj @@ -120,7 +120,7 @@ - + @@ -157,7 +157,7 @@ - +