/// <summary>
        /// Deletes a pull request review.
        /// </summary>
        /// <remarks>https://developer.github.com/v3/pulls/reviews/#delete-a-pending-review</remarks>
        /// <param name="owner">The owner of the repository</param>
        /// <param name="name">The name of the repository</param>
        /// <param name="number">The pull request number</param>
        /// <param name="reviewId">The pull request review number</param>
        public IObservable <Unit> Delete(string owner, string name, int number, long reviewId)
        {
            Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner));
            Ensure.ArgumentNotNullOrEmptyString(name, nameof(name));

            return(_client.Delete(owner, name, number, reviewId).ToObservable());
        }
Пример #2
0
        public async Task CanDeleteReview()
        {
            using (var context = await _github.CreateRepositoryContext("test-repo"))
            {
                await _github.CreateTheWorld(context.Repository);

                var pullRequest = await _github2.CreatePullRequest(context.Repository);

                var createdReview = await _github.CreatePullRequestReview(context.Repository, pullRequest.Number, "A pending review");

                await _client.Delete(context.RepositoryOwner, context.RepositoryName, pullRequest.Number, createdReview.Id);

                var retrievedReviews = await _client.GetAll(context.RepositoryOwner, context.RepositoryName, pullRequest.Number);

                Assert.False(retrievedReviews.Any(x => x.Id == createdReview.Id));
            }
        }