public Create ( long repositoryId, int number, PullRequestReviewCommentCreate comment ) : IObservable |
||
repositoryId | long | The Id of the repository |
number | int | The Pull Request number |
comment | PullRequestReviewCommentCreate | The comment |
return | IObservable |
public async Task EnsuresNonNullArguments() { var gitHubClient = Substitute.For<IGitHubClient>(); var client = new ObservablePullRequestReviewCommentsClient(gitHubClient); string body = "Comment content"; string commitId = "qe3dsdsf6"; string path = "file.css"; int position = 7; var comment = new PullRequestReviewCommentCreate(body, commitId, path, position); Assert.Throws<ArgumentNullException>(() => client.Create(null, "name", 1, comment)); Assert.Throws<ArgumentNullException>(() => client.Create("owner", null, 1, comment)); Assert.Throws<ArgumentNullException>(() => client.Create("owner", "name", 1, null)); Assert.Throws<ArgumentNullException>(() => client.Create(1, 1, null)); Assert.Throws<ArgumentException>(() => client.Create("", "name", 1, comment)); Assert.Throws<ArgumentException>(() => client.Create("owner", "", 1, comment)); }
public void PostsToCorrectUrlWithRepositoryId() { var gitHubClient = Substitute.For<IGitHubClient>(); var client = new ObservablePullRequestReviewCommentsClient(gitHubClient); var comment = new PullRequestReviewCommentCreate("Comment content", "qe3dsdsf6", "file.css", 7); client.Create(1, 13, comment); gitHubClient.PullRequest.ReviewComment.Received().Create(1, 13, comment); }