Octokit.IssueCommentsClient.Create C# (CSharp) Method

Create() public method

Creates a new Issue Comment for a specified Issue.
http://developer.github.com/v3/issues/comments/#create-a-comment
public Create ( long repositoryId, int number, string newComment ) : Task
repositoryId long The Id of the repository
number int The number of the issue
newComment string The new comment to add to the issue
return Task
        public Task<IssueComment> Create(long repositoryId, int number, string newComment)
        {
            Ensure.ArgumentNotNull(newComment, "newComment");

            return ApiConnection.Post<IssueComment>(ApiUrls.IssueComments(repositoryId, number), new BodyWrapper(newComment));
        }

Same methods

IssueCommentsClient::Create ( string owner, string name, int number, string newComment ) : Task

Usage Example

        public void PostsToCorrectUrl()
        {
            const string newComment = "some title";
            var connection = Substitute.For<IApiConnection>();
            var client = new IssueCommentsClient(connection);

            client.Create("fake", "repo", 1, newComment);

            connection.Received().Post<IssueComment>(Arg.Is<Uri>(u => u.ToString() == "repos/fake/repo/issues/1/comments"), Arg.Any<object>());
        }
All Usage Examples Of Octokit.IssueCommentsClient::Create