public async Task EnsuresArgumentsNotNull() { var gitHubClient = Substitute.For <IGitHubClient>(); var client = new ObservablePullRequestReviewCommentsClient(gitHubClient); string body = "Comment content"; int inReplyTo = 7; var comment = new PullRequestReviewCommentReplyCreate(body, inReplyTo); await AssertEx.Throws <ArgumentNullException>(async() => await client.CreateReply(null, "name", 1, comment)); await AssertEx.Throws <ArgumentException>(async() => await client.CreateReply("", "name", 1, comment)); await AssertEx.Throws <ArgumentNullException>(async() => await client.CreateReply("owner", null, 1, comment)); await AssertEx.Throws <ArgumentException>(async() => await client.CreateReply("owner", "", 1, comment)); await AssertEx.Throws <ArgumentNullException>(async() => await client.CreateReply("owner", "name", 1, null)); }
public void PostsToCorrectUrl() { var gitHubClient = Substitute.For <IGitHubClient>(); var client = new ObservablePullRequestReviewCommentsClient(gitHubClient); var comment = new PullRequestReviewCommentReplyCreate("Comment content", 9); client.CreateReply("fakeOwner", "fakeRepoName", 13, comment); gitHubClient.PullRequest.Comment.Received().CreateReply("fakeOwner", "fakeRepoName", 13, comment); }