test if all reactions can be created

This commit is contained in:
Martin Scholz
2016-06-22 08:32:44 +02:00
parent c1a16ffc74
commit bdc222132b
4 changed files with 129 additions and 20 deletions

View File

@@ -33,15 +33,42 @@ public class IssueCommentReactionsClientTests
Assert.NotNull(issueComment);
var issueCommentReaction = await _github.Reaction.IssueComment.Create(_context.RepositoryOwner, _context.RepositoryName, issueComment.Id, new NewReaction(ReactionType.Heart));
var newReactionConfused = new NewReaction(ReactionType.Confused);
var newReactionHeart = new NewReaction(ReactionType.Heart);
var newReactionHooray = new NewReaction(ReactionType.Hooray);
var newReactionLaugh = new NewReaction(ReactionType.Laugh);
var newReactionMinus1 = new NewReaction(ReactionType.Minus1);
var newReactionPlus1 = new NewReaction(ReactionType.Plus1);
var reactionConfused = await _github.Reaction.IssueComment.Create(_context.RepositoryOwner, _context.RepositoryName, issueComment.Id, newReactionConfused);
var reactionHeart = await _github.Reaction.IssueComment.Create(_context.RepositoryOwner, _context.RepositoryName, issueComment.Id, newReactionHeart);
var reactionHooray = await _github.Reaction.IssueComment.Create(_context.RepositoryOwner, _context.RepositoryName, issueComment.Id, newReactionHooray);
var reactionLaugh = await _github.Reaction.IssueComment.Create(_context.RepositoryOwner, _context.RepositoryName, issueComment.Id, newReactionLaugh);
var reactionMinus1 = await _github.Reaction.IssueComment.Create(_context.RepositoryOwner, _context.RepositoryName, issueComment.Id, newReactionMinus1);
var reactionPlus1 = await _github.Reaction.IssueComment.Create(_context.RepositoryOwner, _context.RepositoryName, issueComment.Id, newReactionPlus1);
Assert.NotNull(issueCommentReaction);
Assert.IsType<Reaction>(reactionConfused);
Assert.Equal(ReactionType.Confused, reactionConfused.Content);
Assert.Equal(issueComment.User.Id, reactionConfused.User.Id);
Assert.IsType<Reaction>(issueCommentReaction);
Assert.IsType<Reaction>(reactionHeart);
Assert.Equal(ReactionType.Heart, reactionHeart.Content);
Assert.Equal(issueComment.User.Id, reactionHeart.User.Id);
Assert.Equal(ReactionType.Heart, issueCommentReaction.Content);
Assert.IsType<Reaction>(reactionHooray);
Assert.Equal(ReactionType.Hooray, reactionHooray.Content);
Assert.Equal(issueComment.User.Id, reactionHooray.User.Id);
Assert.Equal(issueComment.User.Id, issueCommentReaction.User.Id);
Assert.IsType<Reaction>(reactionLaugh);
Assert.Equal(ReactionType.Laugh, reactionLaugh.Content);
Assert.Equal(issueComment.User.Id, reactionLaugh.User.Id);
Assert.IsType<Reaction>(reactionMinus1);
Assert.Equal(ReactionType.Minus1, reactionMinus1.Content);
Assert.Equal(issueComment.User.Id, reactionMinus1.User.Id);
Assert.IsType<Reaction>(reactionPlus1);
Assert.Equal(ReactionType.Plus1, reactionPlus1.Content);
Assert.Equal(issueComment.User.Id, reactionPlus1.User.Id);
}
public void Dispose()