mirror of
https://github.com/zoriya/octokit.net.git
synced 2026-06-01 10:25:36 +00:00
change class name for enum reactions
This commit is contained in:
@@ -417,12 +417,12 @@ public class RepositoryCommentsClientTests
|
||||
|
||||
Assert.NotNull(result);
|
||||
|
||||
var newReaction = new NewReaction(EnumReaction.Confused);
|
||||
var newReaction = new NewReaction(ReactionType.Confused);
|
||||
var reaction = await _github.Repository.Comment.CreateReaction(_context.RepositoryOwner, _context.RepositoryName, result.Id, newReaction);
|
||||
|
||||
Assert.IsType<Reaction>(reaction);
|
||||
|
||||
Assert.Equal(EnumReaction.Confused, reaction.Content);
|
||||
Assert.Equal(ReactionType.Confused, reaction.Content);
|
||||
|
||||
Assert.Equal(result.User.Id, reaction.UserId);
|
||||
}
|
||||
|
||||
@@ -245,7 +245,7 @@ public class RepositoryCommentsClientTests
|
||||
[Fact]
|
||||
public void RequestsCorrectUrl()
|
||||
{
|
||||
NewReaction newReaction = new NewReaction(EnumReaction.Heart);
|
||||
NewReaction newReaction = new NewReaction(ReactionType.Heart);
|
||||
|
||||
var connection = Substitute.For<IApiConnection>();
|
||||
var client = new RepositoryCommentsClient(connection);
|
||||
@@ -261,10 +261,10 @@ public class RepositoryCommentsClientTests
|
||||
var connection = Substitute.For<IApiConnection>();
|
||||
var client = new RepositoryCommentsClient(connection);
|
||||
|
||||
await Assert.ThrowsAsync<ArgumentNullException>(() => client.CreateReaction(null, "name", 1, new NewReaction(EnumReaction.Heart)));
|
||||
await Assert.ThrowsAsync<ArgumentException>(() => client.CreateReaction("", "name", 1, new NewReaction(EnumReaction.Heart)));
|
||||
await Assert.ThrowsAsync<ArgumentNullException>(() => client.CreateReaction("owner", null, 1, new NewReaction(EnumReaction.Heart)));
|
||||
await Assert.ThrowsAsync<ArgumentException>(() => client.CreateReaction("owner", "", 1, new NewReaction(EnumReaction.Heart)));
|
||||
await Assert.ThrowsAsync<ArgumentNullException>(() => client.CreateReaction(null, "name", 1, new NewReaction(ReactionType.Heart)));
|
||||
await Assert.ThrowsAsync<ArgumentException>(() => client.CreateReaction("", "name", 1, new NewReaction(ReactionType.Heart)));
|
||||
await Assert.ThrowsAsync<ArgumentNullException>(() => client.CreateReaction("owner", null, 1, new NewReaction(ReactionType.Heart)));
|
||||
await Assert.ThrowsAsync<ArgumentException>(() => client.CreateReaction("owner", "", 1, new NewReaction(ReactionType.Heart)));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -140,7 +140,7 @@ namespace Octokit.Tests.Reactive
|
||||
{
|
||||
var githubClient = Substitute.For<IGitHubClient>();
|
||||
var client = new ObservableRepositoryCommentsClient(githubClient);
|
||||
var newReaction = new NewReaction(EnumReaction.Confused);
|
||||
var newReaction = new NewReaction(ReactionType.Confused);
|
||||
|
||||
client.CreateReaction("fake", "repo", 1, newReaction);
|
||||
githubClient.Received().Repository.Comment.CreateReaction("fake", "repo", 1, newReaction);
|
||||
@@ -152,10 +152,10 @@ namespace Octokit.Tests.Reactive
|
||||
var githubClient = Substitute.For<IGitHubClient>();
|
||||
var client = new ObservableRepositoryCommentsClient(githubClient);
|
||||
|
||||
Assert.Throws<ArgumentNullException>(() => client.CreateReaction(null, "name", 1, new NewReaction(EnumReaction.Heart)));
|
||||
Assert.Throws<ArgumentException>(() => client.CreateReaction("", "name", 1, new NewReaction(EnumReaction.Heart)));
|
||||
Assert.Throws<ArgumentNullException>(() => client.CreateReaction("owner", null, 1, new NewReaction(EnumReaction.Heart)));
|
||||
Assert.Throws<ArgumentException>(() => client.CreateReaction("owner", "", 1, new NewReaction(EnumReaction.Heart)));
|
||||
Assert.Throws<ArgumentNullException>(() => client.CreateReaction(null, "name", 1, new NewReaction(ReactionType.Heart)));
|
||||
Assert.Throws<ArgumentException>(() => client.CreateReaction("", "name", 1, new NewReaction(ReactionType.Heart)));
|
||||
Assert.Throws<ArgumentNullException>(() => client.CreateReaction("owner", null, 1, new NewReaction(ReactionType.Heart)));
|
||||
Assert.Throws<ArgumentException>(() => client.CreateReaction("owner", "", 1, new NewReaction(ReactionType.Heart)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ namespace Octokit
|
||||
/// Initializes a new instance of the <see cref="NewReaction"/> class.
|
||||
/// </summary>
|
||||
/// <param name="content">The reaction type.</param>
|
||||
public NewReaction(EnumReaction content)
|
||||
public NewReaction(ReactionType content)
|
||||
{
|
||||
Content = content;
|
||||
}
|
||||
@@ -18,7 +18,7 @@ namespace Octokit
|
||||
/// <summary>
|
||||
/// The reaction type (required)
|
||||
/// </summary>
|
||||
public EnumReaction Content { get; private set; }
|
||||
public ReactionType Content { get; private set; }
|
||||
|
||||
internal string DebuggerDisplay
|
||||
{
|
||||
|
||||
@@ -5,7 +5,7 @@ using System.Globalization;
|
||||
|
||||
namespace Octokit
|
||||
{
|
||||
public enum EnumReaction
|
||||
public enum ReactionType
|
||||
{
|
||||
[Parameter(Value = "+1")]
|
||||
Plus1,
|
||||
@@ -26,7 +26,7 @@ namespace Octokit
|
||||
{
|
||||
public Reaction() { }
|
||||
|
||||
public Reaction(int id, int userId, EnumReaction content)
|
||||
public Reaction(int id, int userId, ReactionType content)
|
||||
{
|
||||
Id = id;
|
||||
UserId = userId;
|
||||
@@ -47,7 +47,7 @@ namespace Octokit
|
||||
/// The reaction type for this commit comment.
|
||||
/// </summary>
|
||||
[Parameter(Key = "content")]
|
||||
public EnumReaction Content { get; protected set; }
|
||||
public ReactionType Content { get; protected set; }
|
||||
|
||||
internal string DebuggerDisplay
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user