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 ( string owner, string name, int number, string newComment ) : Task
owner string The owner of the repository
name string The name 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(string owner, string name, int number, string newComment)
        {
            Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
            Ensure.ArgumentNotNullOrEmptyString(name, "name");
            Ensure.ArgumentNotNull(newComment, "newComment");

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

Same methods

IssueCommentsClient::Create ( long repositoryId, 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