mirror of
https://github.com/zoriya/octokit.net.git
synced 2025-12-20 06:05:12 +00:00
Implemented pull request review comments API
This commit is contained in:
@@ -0,0 +1,90 @@
|
|||||||
|
using System;
|
||||||
|
using System.Reactive;
|
||||||
|
|
||||||
|
namespace Octokit.Reactive
|
||||||
|
{
|
||||||
|
public interface IObservablePullRequestReviewCommentsClient
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Gets review comments for a specified pull request.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>http://developer.github.com/v3/pulls/comments/#list-comments-on-a-pull-request</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>
|
||||||
|
/// <returns>The list of <see cref="PullRequestReviewComment"/>s for the specified pull request</returns>
|
||||||
|
IObservable<PullRequestReviewComment> GetForPullRequest(string owner, string name, int number);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets a list of the pull request review comments in a specified repository.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>http://developer.github.com/v3/pulls/comments/#list-comments-in-a-repository</remarks>
|
||||||
|
/// <param name="owner">The owner of the repository</param>
|
||||||
|
/// <param name="name">The name of the repository</param>
|
||||||
|
/// <returns>The list of <see cref="PullRequestReviewComment"/>s for the specified repository</returns>
|
||||||
|
IObservable<PullRequestReviewComment> GetForRepository(string owner, string name);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets a list of the pull request review comments in a specified repository.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>http://developer.github.com/v3/pulls/comments/#list-comments-in-a-repository</remarks>
|
||||||
|
/// <param name="owner">The owner of the repository</param>
|
||||||
|
/// <param name="name">The name of the repository</param>
|
||||||
|
/// <param name="request">The sorting <see cref="PullRequestReviewCommentRequest">parameters</see></param>
|
||||||
|
/// <returns>The list of <see cref="PullRequestReviewComment"/>s for the specified repository</returns>
|
||||||
|
IObservable<PullRequestReviewComment> GetForRepository(string owner, string name, PullRequestReviewCommentRequest request);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets a single pull request review comment by number.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>http://developer.github.com/v3/pulls/comments/#get-a-single-comment</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 review comment number</param>
|
||||||
|
/// <returns>The <see cref="PullRequestReviewComment"/></returns>
|
||||||
|
IObservable<PullRequestReviewComment> GetComment(string owner, string name, int number);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Creates a comment on a pull request review.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>http://developer.github.com/v3/pulls/comments/#create-a-comment</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="comment">The comment</param>
|
||||||
|
/// <returns>The created <see cref="PullRequestReviewComment"/></returns>
|
||||||
|
IObservable<PullRequestReviewComment> Create(string owner, string name, int number, PullRequestReviewCommentCreate comment);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Creates a comment on a pull request review as a reply to another comment.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>http://developer.github.com/v3/pulls/comments/#create-a-comment</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="comment">The comment</param>
|
||||||
|
/// <returns>The created <see cref="PullRequestReviewComment"/></returns>
|
||||||
|
IObservable<PullRequestReviewComment> CreateReply(string owner, string name, int number, PullRequestReviewCommentReplyCreate comment);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Edits a comment on a pull request review.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>http://developer.github.com/v3/pulls/comments/#edit-a-comment</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 review comment number</param>
|
||||||
|
/// <param name="comment">The edited comment</param>
|
||||||
|
/// <returns>The edited <see cref="PullRequestReviewComment"/></returns>
|
||||||
|
IObservable<PullRequestReviewComment> Edit(string owner, string name, int number, PullRequestReviewCommentEdit comment);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Deletes a comment on a pull request review.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>http://developer.github.com/v3/pulls/comments/#delete-a-comment</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 review comment number</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
IObservable<Unit> Delete(string owner, string name, int number);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,157 @@
|
|||||||
|
using System;
|
||||||
|
using System.Reactive;
|
||||||
|
using System.Reactive.Threading.Tasks;
|
||||||
|
using Octokit.Reactive.Internal;
|
||||||
|
|
||||||
|
namespace Octokit.Reactive
|
||||||
|
{
|
||||||
|
public class ObservablePullRequestReviewCommentsClient : IObservablePullRequestReviewCommentsClient
|
||||||
|
{
|
||||||
|
readonly IPullRequestReviewCommentsClient _client;
|
||||||
|
readonly IConnection _connection;
|
||||||
|
|
||||||
|
public ObservablePullRequestReviewCommentsClient(IGitHubClient client)
|
||||||
|
{
|
||||||
|
Ensure.ArgumentNotNull(client, "client");
|
||||||
|
|
||||||
|
_client = client.PullRequest.Comment;
|
||||||
|
_connection = client.Connection;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets review comments for a specified pull request.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>http://developer.github.com/v3/pulls/comments/#list-comments-on-a-pull-request</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>
|
||||||
|
/// <returns>The list of <see cref="PullRequestReviewComment"/>s for the specified pull request</returns>
|
||||||
|
public IObservable<PullRequestReviewComment> GetForPullRequest(string owner, string name, int number)
|
||||||
|
{
|
||||||
|
Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
|
||||||
|
Ensure.ArgumentNotNullOrEmptyString(name, "name");
|
||||||
|
|
||||||
|
return _connection.GetAndFlattenAllPages<PullRequestReviewComment>(ApiUrls.PullRequestReviewComments(owner, name, number));
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets a list of the pull request review comments in a specified repository.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>http://developer.github.com/v3/pulls/comments/#list-comments-in-a-repository</remarks>
|
||||||
|
/// <param name="owner">The owner of the repository</param>
|
||||||
|
/// <param name="name">The name of the repository</param>
|
||||||
|
/// <returns>The list of <see cref="PullRequestReviewComment"/>s for the specified repository</returns>
|
||||||
|
public IObservable<PullRequestReviewComment> GetForRepository(string owner, string name)
|
||||||
|
{
|
||||||
|
return GetForRepository(owner, name, new PullRequestReviewCommentRequest());
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets a list of the pull request review comments in a specified repository.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>http://developer.github.com/v3/pulls/comments/#list-comments-in-a-repository</remarks>
|
||||||
|
/// <param name="owner">The owner of the repository</param>
|
||||||
|
/// <param name="name">The name of the repository</param>
|
||||||
|
/// <param name="request">The sorting <see cref="PullRequestReviewCommentRequest">parameters</see></param>
|
||||||
|
/// <returns>The list of <see cref="PullRequestReviewComment"/>s for the specified repository</returns>
|
||||||
|
public IObservable<PullRequestReviewComment> GetForRepository(string owner, string name, PullRequestReviewCommentRequest request)
|
||||||
|
{
|
||||||
|
Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
|
||||||
|
Ensure.ArgumentNotNullOrEmptyString(name, "name");
|
||||||
|
Ensure.ArgumentNotNull(request, "request");
|
||||||
|
|
||||||
|
return _connection.GetAndFlattenAllPages<PullRequestReviewComment>(ApiUrls.PullRequestReviewCommentsRepository(owner, name), request.ToParametersDictionary());
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets a single pull request review comment by number.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>http://developer.github.com/v3/pulls/comments/#get-a-single-comment</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 review comment number</param>
|
||||||
|
/// <returns>The <see cref="PullRequestReviewComment"/></returns>
|
||||||
|
public IObservable<PullRequestReviewComment> GetComment(string owner, string name, int number)
|
||||||
|
{
|
||||||
|
Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
|
||||||
|
Ensure.ArgumentNotNullOrEmptyString(name, "name");
|
||||||
|
|
||||||
|
return _client.GetComment(owner, name, number).ToObservable();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Creates a comment on a pull request review.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>http://developer.github.com/v3/pulls/comments/#create-a-comment</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="comment">The comment</param>
|
||||||
|
/// <returns>The created <see cref="PullRequestReviewComment"/></returns>
|
||||||
|
public IObservable<PullRequestReviewComment> Create(string owner, string name, int number, PullRequestReviewCommentCreate comment)
|
||||||
|
{
|
||||||
|
Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
|
||||||
|
Ensure.ArgumentNotNullOrEmptyString(name, "name");
|
||||||
|
Ensure.ArgumentNotNull(comment, "comment");
|
||||||
|
Ensure.ArgumentNotNullOrEmptyString(comment.Body, "body");
|
||||||
|
Ensure.ArgumentNotNullOrEmptyString(comment.CommitId, "commitId");
|
||||||
|
Ensure.ArgumentNotNullOrEmptyString(comment.Path, "path");
|
||||||
|
|
||||||
|
return _client.Create(owner, name, number, comment).ToObservable();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Creates a comment on a pull request review as a reply to another comment.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>http://developer.github.com/v3/pulls/comments/#create-a-comment</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="comment">The comment</param>
|
||||||
|
/// <returns>The created <see cref="PullRequestReviewComment"/></returns>
|
||||||
|
public IObservable<PullRequestReviewComment> CreateReply(string owner, string name, int number, PullRequestReviewCommentReplyCreate comment)
|
||||||
|
{
|
||||||
|
Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
|
||||||
|
Ensure.ArgumentNotNullOrEmptyString(name, "name");
|
||||||
|
Ensure.ArgumentNotNull(comment, "comment");
|
||||||
|
Ensure.ArgumentNotNullOrEmptyString(comment.Body, "body");
|
||||||
|
|
||||||
|
return _client.CreateReply(owner, name, number, comment).ToObservable();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Edits a comment on a pull request review.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>http://developer.github.com/v3/pulls/comments/#edit-a-comment</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 review comment number</param>
|
||||||
|
/// <param name="comment">The edited comment</param>
|
||||||
|
/// <returns>The edited <see cref="PullRequestReviewComment"/></returns>
|
||||||
|
public IObservable<PullRequestReviewComment> Edit(string owner, string name, int number, PullRequestReviewCommentEdit comment)
|
||||||
|
{
|
||||||
|
Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
|
||||||
|
Ensure.ArgumentNotNullOrEmptyString(name, "name");
|
||||||
|
Ensure.ArgumentNotNull(comment, "comment");
|
||||||
|
Ensure.ArgumentNotNullOrEmptyString(comment.Body, "body");
|
||||||
|
|
||||||
|
return _client.Edit(owner, name, number, comment).ToObservable();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Deletes a comment on a pull request review.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>http://developer.github.com/v3/pulls/comments/#delete-a-comment</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 review comment number</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public IObservable<Unit> Delete(string owner, string name, int number)
|
||||||
|
{
|
||||||
|
Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
|
||||||
|
Ensure.ArgumentNotNullOrEmptyString(name, "name");
|
||||||
|
|
||||||
|
return _client.Delete(owner, name, number).ToObservable();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -74,6 +74,7 @@
|
|||||||
<Link>Properties\SolutionInfo.cs</Link>
|
<Link>Properties\SolutionInfo.cs</Link>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="Clients\IObservableCommitsClient.cs" />
|
<Compile Include="Clients\IObservableCommitsClient.cs" />
|
||||||
|
<Compile Include="Clients\IObservablePullRequestReviewCommentsClient.cs" />
|
||||||
<Compile Include="Clients\ObservableCommitsClient.cs" />
|
<Compile Include="Clients\ObservableCommitsClient.cs" />
|
||||||
<Compile Include="Clients\IObservableEventsClient.cs" />
|
<Compile Include="Clients\IObservableEventsClient.cs" />
|
||||||
<Compile Include="Clients\ObservableEventsClient.cs" />
|
<Compile Include="Clients\ObservableEventsClient.cs" />
|
||||||
@@ -97,6 +98,7 @@
|
|||||||
<Compile Include="Clients\ObservableMiscellaneousClient.cs" />
|
<Compile Include="Clients\ObservableMiscellaneousClient.cs" />
|
||||||
<Compile Include="Clients\ObservableOrganizationMembersClient.cs" />
|
<Compile Include="Clients\ObservableOrganizationMembersClient.cs" />
|
||||||
<Compile Include="Clients\ObservableOrganizationsClient.cs" />
|
<Compile Include="Clients\ObservableOrganizationsClient.cs" />
|
||||||
|
<Compile Include="Clients\ObservablePullRequestReviewCommentsClient.cs" />
|
||||||
<Compile Include="Clients\ObservableReleasesClient.cs" />
|
<Compile Include="Clients\ObservableReleasesClient.cs" />
|
||||||
<Compile Include="Clients\ObservableRepositoriesClient.cs" />
|
<Compile Include="Clients\ObservableRepositoriesClient.cs" />
|
||||||
<Compile Include="Clients\ObservableSshKeysClient.cs" />
|
<Compile Include="Clients\ObservableSshKeysClient.cs" />
|
||||||
|
|||||||
312
Octokit.Tests/Clients/PullRequestReviewCommentsClientTests.cs
Normal file
312
Octokit.Tests/Clients/PullRequestReviewCommentsClientTests.cs
Normal file
@@ -0,0 +1,312 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using NSubstitute;
|
||||||
|
using Octokit;
|
||||||
|
using Octokit.Tests.Helpers;
|
||||||
|
using Xunit;
|
||||||
|
|
||||||
|
public class PullRequestReviewCommentsClientTests
|
||||||
|
{
|
||||||
|
public class TheGetForPullRequestMethod
|
||||||
|
{
|
||||||
|
[Fact]
|
||||||
|
public void RequestsCorrectUrl()
|
||||||
|
{
|
||||||
|
var connection = Substitute.For<IApiConnection>();
|
||||||
|
var client = new PullRequestReviewCommentsClient(connection);
|
||||||
|
|
||||||
|
client.GetForPullRequest("fakeOwner", "fakeRepoName", 7);
|
||||||
|
|
||||||
|
connection.Received().GetAll<PullRequestReviewComment>(Arg.Is<Uri>(u => u.ToString() == "repos/fakeOwner/fakeRepoName/pulls/7/comments"));
|
||||||
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public async Task EnsuresArgumentsNotNull()
|
||||||
|
{
|
||||||
|
var connection = Substitute.For<IApiConnection>();
|
||||||
|
var client = new PullRequestReviewCommentsClient(connection);
|
||||||
|
|
||||||
|
await AssertEx.Throws<ArgumentNullException>(async () => await client.GetForPullRequest(null, "name", 1));
|
||||||
|
await AssertEx.Throws<ArgumentException>(async () => await client.GetForPullRequest("", "name", 1));
|
||||||
|
await AssertEx.Throws<ArgumentNullException>(async () => await client.GetForPullRequest("owner", null, 1));
|
||||||
|
await AssertEx.Throws<ArgumentException>(async () => await client.GetForPullRequest("owner", "", 1));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public class TheGetForRepositoryMethod
|
||||||
|
{
|
||||||
|
[Fact]
|
||||||
|
public void RequestsCorrectUrl()
|
||||||
|
{
|
||||||
|
var connection = Substitute.For<IApiConnection>();
|
||||||
|
var client = new PullRequestReviewCommentsClient(connection);
|
||||||
|
|
||||||
|
var request = new PullRequestReviewCommentRequest
|
||||||
|
{
|
||||||
|
Direction = SortDirection.Descending,
|
||||||
|
Since = new DateTimeOffset(2013, 11, 15, 11, 43, 01, 00, new TimeSpan()),
|
||||||
|
Sort = PullRequestReviewCommentSort.Updated,
|
||||||
|
};
|
||||||
|
|
||||||
|
client.GetForRepository("fakeOwner", "fakeRepoName", request);
|
||||||
|
|
||||||
|
connection.Received().GetAll<PullRequestReviewComment>(Arg.Is<Uri>(u => u.ToString() == "repos/fakeOwner/fakeRepoName/pulls/comments"),
|
||||||
|
Arg.Is<Dictionary<string, string>>(d => d.Count == 3
|
||||||
|
&& d["direction"] == "desc"
|
||||||
|
&& d["since"] == "2013-11-15T11:43:01Z"
|
||||||
|
&& d["sort"] == "updated"));
|
||||||
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public void RequestsCorrectUrlWithoutSelectedSortingArguments()
|
||||||
|
{
|
||||||
|
var connection = Substitute.For<IApiConnection>();
|
||||||
|
var client = new PullRequestReviewCommentsClient(connection);
|
||||||
|
|
||||||
|
client.GetForRepository("fakeOwner", "fakeRepoName");
|
||||||
|
|
||||||
|
connection.Received().GetAll<PullRequestReviewComment>(Arg.Is<Uri>(u => u.ToString() == "repos/fakeOwner/fakeRepoName/pulls/comments"),
|
||||||
|
Arg.Is<Dictionary<string, string>>(d => d.Count == 2
|
||||||
|
&& d["direction"] == "asc"
|
||||||
|
&& d["sort"] == "created"));
|
||||||
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public async Task EnsuresArgumentsNotNull()
|
||||||
|
{
|
||||||
|
var client = new PullRequestReviewCommentsClient(Substitute.For<IApiConnection>());
|
||||||
|
|
||||||
|
var request = new PullRequestReviewCommentRequest();
|
||||||
|
|
||||||
|
await AssertEx.Throws<ArgumentNullException>(async () => await client.GetForRepository(null, "name", request));
|
||||||
|
await AssertEx.Throws<ArgumentException>(async () => await client.GetForRepository("", "name", request));
|
||||||
|
await AssertEx.Throws<ArgumentNullException>(async () => await client.GetForRepository("owner", null, request));
|
||||||
|
await AssertEx.Throws<ArgumentException>(async () => await client.GetForRepository("owner", "", request));
|
||||||
|
await AssertEx.Throws<ArgumentNullException>(async () => await client.GetForRepository("owner", "name", null));
|
||||||
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public async Task EnsuresDefaultValues()
|
||||||
|
{
|
||||||
|
var request = new PullRequestReviewCommentRequest();
|
||||||
|
|
||||||
|
Assert.Equal(SortDirection.Ascending, request.Direction);
|
||||||
|
Assert.Null(request.Since);
|
||||||
|
Assert.Equal(PullRequestReviewCommentSort.Created, request.Sort);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public class TheGetCommentMethod
|
||||||
|
{
|
||||||
|
[Fact]
|
||||||
|
public void RequestsCorrectUrl()
|
||||||
|
{
|
||||||
|
var connection = Substitute.For<IApiConnection>();
|
||||||
|
var client = new PullRequestReviewCommentsClient(connection);
|
||||||
|
|
||||||
|
client.GetComment("fakeOwner", "fakeRepoName", 53);
|
||||||
|
|
||||||
|
connection.Received().Get<PullRequestReviewComment>(Arg.Is<Uri>(u => u.ToString() == "repos/fakeOwner/fakeRepoName/pulls/comments/53"),
|
||||||
|
null);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public async Task EnsuresArgumentsNotNull()
|
||||||
|
{
|
||||||
|
var client = new PullRequestReviewCommentsClient(Substitute.For<IApiConnection>());
|
||||||
|
|
||||||
|
await AssertEx.Throws<ArgumentNullException>(async () => await client.GetComment(null, "name", 1));
|
||||||
|
await AssertEx.Throws<ArgumentException>(async () => await client.GetComment("", "name", 1));
|
||||||
|
await AssertEx.Throws<ArgumentNullException>(async () => await client.GetComment("owner", null, 1));
|
||||||
|
await AssertEx.Throws<ArgumentException>(async () => await client.GetComment("owner", "", 1));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public class TheCreateMethod
|
||||||
|
{
|
||||||
|
[Fact]
|
||||||
|
public void PostsToCorrectUrl()
|
||||||
|
{
|
||||||
|
var connection = Substitute.For<IApiConnection>();
|
||||||
|
var client = new PullRequestReviewCommentsClient(connection);
|
||||||
|
|
||||||
|
var comment = new PullRequestReviewCommentCreate
|
||||||
|
{
|
||||||
|
Body = "Comment content",
|
||||||
|
CommitId = "qe3dsdsf6",
|
||||||
|
Path = "file.css",
|
||||||
|
Position = 7,
|
||||||
|
};
|
||||||
|
|
||||||
|
client.Create("fakeOwner", "fakeRepoName", 13, comment);
|
||||||
|
|
||||||
|
connection.Received().Post<PullRequestReviewComment>(Arg.Is<Uri>(u => u.ToString() == "repos/fakeOwner/fakeRepoName/pulls/13/comments"),
|
||||||
|
comment);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public async Task EnsuresArgumentsNotNull()
|
||||||
|
{
|
||||||
|
var connection = Substitute.For<IApiConnection>();
|
||||||
|
var client = new PullRequestReviewCommentsClient(connection);
|
||||||
|
|
||||||
|
string body = "Comment content";
|
||||||
|
string commitId = "qe3dsdsf6";
|
||||||
|
string path = "file.css";
|
||||||
|
int position = 7;
|
||||||
|
|
||||||
|
var comment = new PullRequestReviewCommentCreate
|
||||||
|
{
|
||||||
|
Body = body,
|
||||||
|
CommitId = commitId,
|
||||||
|
Path = path,
|
||||||
|
Position = position,
|
||||||
|
};
|
||||||
|
|
||||||
|
await AssertEx.Throws<ArgumentNullException>(async () => await client.Create(null, "fakeRepoName", 1, comment));
|
||||||
|
await AssertEx.Throws<ArgumentException>(async () => await client.Create("", "fakeRepoName", 1, comment));
|
||||||
|
await AssertEx.Throws<ArgumentNullException>(async () => await client.Create("fakeOwner", null, 1, comment));
|
||||||
|
await AssertEx.Throws<ArgumentException>(async () => await client.Create("fakeOwner", "", 1, comment));
|
||||||
|
await AssertEx.Throws<ArgumentException>(async () => await client.Create("fakeOwner", "fakeRepoName", 1, null));
|
||||||
|
|
||||||
|
comment.Body = null;
|
||||||
|
await AssertEx.Throws<ArgumentNullException>(async () => await client.Create("fakeOwner", "fakeRepoName", 1, comment));
|
||||||
|
comment.Body = "";
|
||||||
|
await AssertEx.Throws<ArgumentException>(async () => await client.Create("fakeOwner", "fakeRepoName", 1, comment));
|
||||||
|
comment.Body = body;
|
||||||
|
|
||||||
|
comment.CommitId = null;
|
||||||
|
await AssertEx.Throws<ArgumentNullException>(async () => await client.Create("fakeOwner", "fakeRepoName", 1, comment));
|
||||||
|
comment.CommitId = "";
|
||||||
|
await AssertEx.Throws<ArgumentException>(async () => await client.Create("fakeOwner", "fakeRepoName", 1, comment));
|
||||||
|
comment.CommitId = commitId;
|
||||||
|
|
||||||
|
comment.Path = null;
|
||||||
|
await AssertEx.Throws<ArgumentNullException>(async () => await client.Create("fakeOwner", "fakeRepoName", 1, comment));
|
||||||
|
comment.Path = "";
|
||||||
|
await AssertEx.Throws<ArgumentException>(async () => await client.Create("fakeOwner", "fakeRepoName", 1, comment));
|
||||||
|
comment.Path = path;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public class TheCreateReplyMethod
|
||||||
|
{
|
||||||
|
[Fact]
|
||||||
|
public void PostsToCorrectUrl()
|
||||||
|
{
|
||||||
|
var connection = Substitute.For<IApiConnection>();
|
||||||
|
var client = new PullRequestReviewCommentsClient(connection);
|
||||||
|
|
||||||
|
var comment = new PullRequestReviewCommentReplyCreate
|
||||||
|
{
|
||||||
|
Body = "Comment content",
|
||||||
|
InReplyTo = 5
|
||||||
|
};
|
||||||
|
|
||||||
|
client.CreateReply("fakeOwner", "fakeRepoName", 13, comment);
|
||||||
|
|
||||||
|
connection.Received().Post<PullRequestReviewComment>(Arg.Is<Uri>(u => u.ToString() == "repos/fakeOwner/fakeRepoName/pulls/13/comments"),
|
||||||
|
comment);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public async Task EnsuresArgumentsNotNull()
|
||||||
|
{
|
||||||
|
var connection = Substitute.For<IApiConnection>();
|
||||||
|
var client = new PullRequestReviewCommentsClient(connection);
|
||||||
|
|
||||||
|
string body = "Comment content";
|
||||||
|
int inReplyTo = 7;
|
||||||
|
|
||||||
|
var comment = new PullRequestReviewCommentReplyCreate
|
||||||
|
{
|
||||||
|
Body = body,
|
||||||
|
InReplyTo = inReplyTo,
|
||||||
|
};
|
||||||
|
|
||||||
|
await AssertEx.Throws<ArgumentNullException>(async () => await client.CreateReply(null, "fakeRepoName", 1, comment));
|
||||||
|
await AssertEx.Throws<ArgumentException>(async () => await client.CreateReply("", "fakeRepoName", 1, comment));
|
||||||
|
await AssertEx.Throws<ArgumentNullException>(async () => await client.CreateReply("fakeOwner", null, 1, comment));
|
||||||
|
await AssertEx.Throws<ArgumentException>(async () => await client.CreateReply("fakeOwner", "", 1, comment));
|
||||||
|
await AssertEx.Throws<ArgumentException>(async () => await client.CreateReply("fakeOwner", "fakeRepoName", 1, null));
|
||||||
|
|
||||||
|
comment.Body = null;
|
||||||
|
await AssertEx.Throws<ArgumentNullException>(async () => await client.CreateReply("fakeOwner", "fakeRepoName", 1, comment));
|
||||||
|
comment.Body = "";
|
||||||
|
await AssertEx.Throws<ArgumentException>(async () => await client.CreateReply("fakeOwner", "fakeRepoName", 1, comment));
|
||||||
|
comment.Body = body;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public class TheEditMethod
|
||||||
|
{
|
||||||
|
[Fact]
|
||||||
|
public void PostsToCorrectUrl()
|
||||||
|
{
|
||||||
|
var connection = Substitute.For<IApiConnection>();
|
||||||
|
var client = new PullRequestReviewCommentsClient(connection);
|
||||||
|
|
||||||
|
var comment = new PullRequestReviewCommentEdit
|
||||||
|
{
|
||||||
|
Body = "New comment content",
|
||||||
|
};
|
||||||
|
|
||||||
|
client.Edit("fakeOwner", "fakeRepoName", 13, comment);
|
||||||
|
|
||||||
|
connection.Received().Patch<PullRequestReviewComment>(Arg.Is<Uri>(u => u.ToString() == "repos/fakeOwner/fakeRepoName/pulls/comments/13"), comment);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public async Task EnsuresArgumentsNotNull()
|
||||||
|
{
|
||||||
|
var connection = Substitute.For<IApiConnection>();
|
||||||
|
var client = new PullRequestReviewCommentsClient(connection);
|
||||||
|
|
||||||
|
var body = "New comment content";
|
||||||
|
|
||||||
|
var comment = new PullRequestReviewCommentEdit
|
||||||
|
{
|
||||||
|
Body = body,
|
||||||
|
};
|
||||||
|
|
||||||
|
await AssertEx.Throws<ArgumentNullException>(async () => await client.Edit(null, "fakeRepoName", 1, comment));
|
||||||
|
await AssertEx.Throws<ArgumentException>(async () => await client.Edit("", "fakeRepoName", 1, comment));
|
||||||
|
await AssertEx.Throws<ArgumentNullException>(async () => await client.Edit("fakeOwner", null, 1, comment));
|
||||||
|
await AssertEx.Throws<ArgumentException>(async () => await client.Edit("fakeOwner", "", 1, comment));
|
||||||
|
await AssertEx.Throws<ArgumentNullException>(async () => await client.Edit("fakeOwner", null, 1, null));
|
||||||
|
|
||||||
|
comment.Body = null;
|
||||||
|
await AssertEx.Throws<ArgumentNullException>(async () => await client.Edit("fakeOwner", "fakeRepoName", 1, comment));
|
||||||
|
comment.Body = "";
|
||||||
|
await AssertEx.Throws<ArgumentException>(async () => await client.Edit("fakeOwner", "fakeRepoName", 1, comment));
|
||||||
|
comment.Body = body;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public class TheDeleteMethod
|
||||||
|
{
|
||||||
|
[Fact]
|
||||||
|
public void PostsToCorrectUrl()
|
||||||
|
{
|
||||||
|
var connection = Substitute.For<IApiConnection>();
|
||||||
|
var client = new PullRequestReviewCommentsClient(connection);
|
||||||
|
|
||||||
|
client.Delete("fakeOwner", "fakeRepoName", 13);
|
||||||
|
|
||||||
|
connection.Received().Delete(Arg.Is<Uri>(u => u.ToString() == "repos/fakeOwner/fakeRepoName/pulls/comments/13"));
|
||||||
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public async Task EnsuresArgumentsNotNull()
|
||||||
|
{
|
||||||
|
var connection = Substitute.For<IApiConnection>();
|
||||||
|
var client = new PullRequestReviewCommentsClient(connection);
|
||||||
|
|
||||||
|
await AssertEx.Throws<ArgumentNullException>(async () => await client.Delete(null, "fakeRepoName", 1));
|
||||||
|
await AssertEx.Throws<ArgumentException>(async () => await client.Delete("", "fakeRepoName", 1));
|
||||||
|
await AssertEx.Throws<ArgumentNullException>(async () => await client.Delete("fakeOwner", null, 1));
|
||||||
|
await AssertEx.Throws<ArgumentException>(async () => await client.Delete("fakeOwner", "", 1));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -66,6 +66,7 @@
|
|||||||
<Compile Include="Clients\AssigneesClientTests.cs" />
|
<Compile Include="Clients\AssigneesClientTests.cs" />
|
||||||
<Compile Include="Clients\CommitsClientTests.cs" />
|
<Compile Include="Clients\CommitsClientTests.cs" />
|
||||||
<Compile Include="Clients\CommitStatusClientTests.cs" />
|
<Compile Include="Clients\CommitStatusClientTests.cs" />
|
||||||
|
<Compile Include="Clients\PullRequestReviewCommentsClientTests.cs" />
|
||||||
<Compile Include="Clients\TeamsClientTests.cs" />
|
<Compile Include="Clients\TeamsClientTests.cs" />
|
||||||
<Compile Include="Clients\GitDatabaseClientTests.cs" />
|
<Compile Include="Clients\GitDatabaseClientTests.cs" />
|
||||||
<Compile Include="Clients\OrganizationMembersClientTests.cs" />
|
<Compile Include="Clients\OrganizationMembersClientTests.cs" />
|
||||||
@@ -122,6 +123,7 @@
|
|||||||
<Compile Include="Reactive\ObservableIssuesClientTests.cs" />
|
<Compile Include="Reactive\ObservableIssuesClientTests.cs" />
|
||||||
<Compile Include="Reactive\ObservableMilestonesClientTests.cs" />
|
<Compile Include="Reactive\ObservableMilestonesClientTests.cs" />
|
||||||
<Compile Include="Reactive\ObservableOrganizationMembersClientTests.cs" />
|
<Compile Include="Reactive\ObservableOrganizationMembersClientTests.cs" />
|
||||||
|
<Compile Include="Reactive\ObservablePullRequestReviewCommentsClientTests.cs" />
|
||||||
<Compile Include="Reactive\ObservableRepositoriesClientTests.cs" />
|
<Compile Include="Reactive\ObservableRepositoriesClientTests.cs" />
|
||||||
<Compile Include="SimpleJsonSerializerTests.cs" />
|
<Compile Include="SimpleJsonSerializerTests.cs" />
|
||||||
<Compile Include="Clients\UsersClientTests.cs" />
|
<Compile Include="Clients\UsersClientTests.cs" />
|
||||||
|
|||||||
@@ -0,0 +1,456 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Reactive.Linq;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using NSubstitute;
|
||||||
|
using Octokit.Internal;
|
||||||
|
using Octokit.Reactive;
|
||||||
|
using Octokit.Tests.Helpers;
|
||||||
|
using Xunit;
|
||||||
|
|
||||||
|
namespace Octokit.Tests.Reactive
|
||||||
|
{
|
||||||
|
public class ObservablePullRequestReviewCommentsClientTests
|
||||||
|
{
|
||||||
|
static ApiInfo CreateApiInfo(IDictionary<string, Uri> links)
|
||||||
|
{
|
||||||
|
return new ApiInfo(links, new List<string>(), new List<string>(), "etag", new RateLimit(new Dictionary<string, string>()));
|
||||||
|
}
|
||||||
|
|
||||||
|
public class TheGetForPullRequestMethod
|
||||||
|
{
|
||||||
|
[Fact]
|
||||||
|
public async Task RequestsCorrectUrl()
|
||||||
|
{
|
||||||
|
var firstPageUrl = new Uri("repos/fakeOwner/fakeRepoName/pulls/7/comments", UriKind.Relative);
|
||||||
|
var secondPageUrl = new Uri("https://example.com/page/2");
|
||||||
|
var firstPageLinks = new Dictionary<string, Uri> { { "next", secondPageUrl } };
|
||||||
|
var firstPageResponse = new ApiResponse<List<PullRequestReviewComment>>
|
||||||
|
{
|
||||||
|
BodyAsObject = new List<PullRequestReviewComment>
|
||||||
|
{
|
||||||
|
new PullRequestReviewComment {Id = 1},
|
||||||
|
new PullRequestReviewComment {Id = 2},
|
||||||
|
new PullRequestReviewComment {Id = 3}
|
||||||
|
},
|
||||||
|
ApiInfo = CreateApiInfo(firstPageLinks)
|
||||||
|
};
|
||||||
|
var thirdPageUrl = new Uri("https://example.com/page/3");
|
||||||
|
var secondPageLinks = new Dictionary<string, Uri> { { "next", thirdPageUrl } };
|
||||||
|
var secondPageResponse = new ApiResponse<List<PullRequestReviewComment>>
|
||||||
|
{
|
||||||
|
BodyAsObject = new List<PullRequestReviewComment>
|
||||||
|
{
|
||||||
|
new PullRequestReviewComment {Id = 4},
|
||||||
|
new PullRequestReviewComment {Id = 5},
|
||||||
|
new PullRequestReviewComment {Id = 6}
|
||||||
|
},
|
||||||
|
ApiInfo = CreateApiInfo(secondPageLinks)
|
||||||
|
};
|
||||||
|
var lastPageResponse = new ApiResponse<List<PullRequestReviewComment>>
|
||||||
|
{
|
||||||
|
BodyAsObject = new List<PullRequestReviewComment>
|
||||||
|
{
|
||||||
|
new PullRequestReviewComment {Id = 7}
|
||||||
|
},
|
||||||
|
ApiInfo = CreateApiInfo(new Dictionary<string, Uri>())
|
||||||
|
};
|
||||||
|
|
||||||
|
var gitHubClient = Substitute.For<IGitHubClient>();
|
||||||
|
gitHubClient.Connection.GetAsync<List<PullRequestReviewComment>>(firstPageUrl)
|
||||||
|
.Returns(Task.Factory.StartNew<IResponse<List<PullRequestReviewComment>>>(() => firstPageResponse));
|
||||||
|
gitHubClient.Connection.GetAsync<List<PullRequestReviewComment>>(secondPageUrl)
|
||||||
|
.Returns(Task.Factory.StartNew<IResponse<List<PullRequestReviewComment>>>(() => secondPageResponse));
|
||||||
|
gitHubClient.Connection.GetAsync<List<PullRequestReviewComment>>(thirdPageUrl)
|
||||||
|
.Returns(Task.Factory.StartNew<IResponse<List<PullRequestReviewComment>>>(() => lastPageResponse));
|
||||||
|
|
||||||
|
var client = new ObservablePullRequestReviewCommentsClient(gitHubClient);
|
||||||
|
|
||||||
|
var results = await client.GetForPullRequest("fakeOwner", "fakeRepoName", 7).ToArray();
|
||||||
|
|
||||||
|
Assert.Equal(7, results.Length);
|
||||||
|
gitHubClient.Connection.Received(1).GetAsync<List<PullRequestReviewComment>>(firstPageUrl, null, null);
|
||||||
|
gitHubClient.Connection.Received(1).GetAsync<List<PullRequestReviewComment>>(secondPageUrl, null, null);
|
||||||
|
gitHubClient.Connection.Received(1).GetAsync<List<PullRequestReviewComment>>(thirdPageUrl, null, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public async Task EnsuresArgumentsNotNull()
|
||||||
|
{
|
||||||
|
var gitHubClient = Substitute.For<IGitHubClient>();
|
||||||
|
var client = new ObservablePullRequestReviewCommentsClient(gitHubClient);
|
||||||
|
|
||||||
|
await AssertEx.Throws<ArgumentNullException>(async () => await client.GetForPullRequest(null, "name", 1));
|
||||||
|
await AssertEx.Throws<ArgumentException>(async () => await client.GetForPullRequest("", "name", 1));
|
||||||
|
await AssertEx.Throws<ArgumentNullException>(async () => await client.GetForPullRequest("owner", null, 1));
|
||||||
|
await AssertEx.Throws<ArgumentException>(async () => await client.GetForPullRequest("owner", "", 1));
|
||||||
|
await AssertEx.Throws<ArgumentNullException>(async () => await client.GetForPullRequest(null, null, 1));
|
||||||
|
await AssertEx.Throws<ArgumentException>(async () => await client.GetForPullRequest("", "", 1));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public class TheGetForRepositoryMethod
|
||||||
|
{
|
||||||
|
[Fact]
|
||||||
|
public async Task RequestsCorrectUrl()
|
||||||
|
{
|
||||||
|
var firstPageUrl = new Uri("repos/fakeOwner/fakeRepoName/pulls/comments", UriKind.Relative);
|
||||||
|
var secondPageUrl = new Uri("https://example.com/page/2");
|
||||||
|
var firstPageLinks = new Dictionary<string, Uri> { { "next", secondPageUrl } };
|
||||||
|
var firstPageResponse = new ApiResponse<List<PullRequestReviewComment>>
|
||||||
|
{
|
||||||
|
BodyAsObject = new List<PullRequestReviewComment>
|
||||||
|
{
|
||||||
|
new PullRequestReviewComment {Id = 1},
|
||||||
|
new PullRequestReviewComment {Id = 2},
|
||||||
|
new PullRequestReviewComment {Id = 3}
|
||||||
|
},
|
||||||
|
ApiInfo = CreateApiInfo(firstPageLinks)
|
||||||
|
};
|
||||||
|
var thirdPageUrl = new Uri("https://example.com/page/3");
|
||||||
|
var secondPageLinks = new Dictionary<string, Uri> { { "next", thirdPageUrl } };
|
||||||
|
var secondPageResponse = new ApiResponse<List<PullRequestReviewComment>>
|
||||||
|
{
|
||||||
|
BodyAsObject = new List<PullRequestReviewComment>
|
||||||
|
{
|
||||||
|
new PullRequestReviewComment {Id = 4},
|
||||||
|
new PullRequestReviewComment {Id = 5},
|
||||||
|
new PullRequestReviewComment {Id = 6}
|
||||||
|
},
|
||||||
|
ApiInfo = CreateApiInfo(secondPageLinks)
|
||||||
|
};
|
||||||
|
var lastPageResponse = new ApiResponse<List<PullRequestReviewComment>>
|
||||||
|
{
|
||||||
|
BodyAsObject = new List<PullRequestReviewComment>
|
||||||
|
{
|
||||||
|
new PullRequestReviewComment {Id = 7},
|
||||||
|
new PullRequestReviewComment {Id = 8},
|
||||||
|
},
|
||||||
|
ApiInfo = CreateApiInfo(new Dictionary<string, Uri>())
|
||||||
|
};
|
||||||
|
|
||||||
|
var gitHubClient = Substitute.For<IGitHubClient>();
|
||||||
|
|
||||||
|
gitHubClient.Connection.GetAsync<List<PullRequestReviewComment>>(firstPageUrl,
|
||||||
|
Arg.Is<Dictionary<string, string>>(d => d.Count == 3
|
||||||
|
&& d["direction"] == "desc"
|
||||||
|
&& d["since"] == "2013-11-15T11:43:01Z"
|
||||||
|
&& d["sort"] == "updated"), null)
|
||||||
|
.Returns(Task.Factory.StartNew<IResponse<List<PullRequestReviewComment>>>(() => firstPageResponse));
|
||||||
|
gitHubClient.Connection.GetAsync<List<PullRequestReviewComment>>(secondPageUrl, null, null)
|
||||||
|
.Returns(Task.Factory.StartNew<IResponse<List<PullRequestReviewComment>>>(() => secondPageResponse));
|
||||||
|
gitHubClient.Connection.GetAsync<List<PullRequestReviewComment>>(thirdPageUrl, null, null)
|
||||||
|
.Returns(Task.Factory.StartNew<IResponse<List<PullRequestReviewComment>>>(() => lastPageResponse));
|
||||||
|
|
||||||
|
var client = new ObservablePullRequestReviewCommentsClient(gitHubClient);
|
||||||
|
|
||||||
|
var request = new PullRequestReviewCommentRequest
|
||||||
|
{
|
||||||
|
Direction = SortDirection.Descending,
|
||||||
|
Since = new DateTimeOffset(2013, 11, 15, 11, 43, 01, 00, new TimeSpan()),
|
||||||
|
Sort = PullRequestReviewCommentSort.Updated,
|
||||||
|
};
|
||||||
|
|
||||||
|
var results = await client.GetForRepository("fakeOwner", "fakeRepoName", request).ToArray();
|
||||||
|
|
||||||
|
Assert.Equal(8, results.Length);
|
||||||
|
gitHubClient.Connection.Received(1).GetAsync<List<PullRequestReviewComment>>(firstPageUrl,
|
||||||
|
Arg.Is<Dictionary<string, string>>(d => d.Count == 3
|
||||||
|
&& d["direction"] == "desc"
|
||||||
|
&& d["since"] == "2013-11-15T11:43:01Z"
|
||||||
|
&& d["sort"] == "updated"), null);
|
||||||
|
gitHubClient.Connection.Received(1).GetAsync<List<PullRequestReviewComment>>(secondPageUrl, null, null);
|
||||||
|
gitHubClient.Connection.Received(1).GetAsync<List<PullRequestReviewComment>>(thirdPageUrl, null, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public async Task RequestsCorrectUrlWithoutSelectedSortingArguments()
|
||||||
|
{
|
||||||
|
var firstPageUrl = new Uri("repos/fakeOwner/fakeRepoName/pulls/comments", UriKind.Relative);
|
||||||
|
var secondPageUrl = new Uri("https://example.com/page/2");
|
||||||
|
var firstPageLinks = new Dictionary<string, Uri> { { "next", secondPageUrl } };
|
||||||
|
var firstPageResponse = new ApiResponse<List<PullRequestReviewComment>>
|
||||||
|
{
|
||||||
|
BodyAsObject = new List<PullRequestReviewComment>
|
||||||
|
{
|
||||||
|
new PullRequestReviewComment {Id = 1},
|
||||||
|
new PullRequestReviewComment {Id = 2},
|
||||||
|
new PullRequestReviewComment {Id = 3}
|
||||||
|
},
|
||||||
|
ApiInfo = CreateApiInfo(firstPageLinks)
|
||||||
|
};
|
||||||
|
var thirdPageUrl = new Uri("https://example.com/page/3");
|
||||||
|
var secondPageLinks = new Dictionary<string, Uri> { { "next", thirdPageUrl } };
|
||||||
|
var secondPageResponse = new ApiResponse<List<PullRequestReviewComment>>
|
||||||
|
{
|
||||||
|
BodyAsObject = new List<PullRequestReviewComment>
|
||||||
|
{
|
||||||
|
new PullRequestReviewComment {Id = 4},
|
||||||
|
new PullRequestReviewComment {Id = 5},
|
||||||
|
new PullRequestReviewComment {Id = 6}
|
||||||
|
},
|
||||||
|
ApiInfo = CreateApiInfo(secondPageLinks)
|
||||||
|
};
|
||||||
|
var lastPageResponse = new ApiResponse<List<PullRequestReviewComment>>
|
||||||
|
{
|
||||||
|
BodyAsObject = new List<PullRequestReviewComment>
|
||||||
|
{
|
||||||
|
new PullRequestReviewComment {Id = 7},
|
||||||
|
new PullRequestReviewComment {Id = 8},
|
||||||
|
},
|
||||||
|
ApiInfo = CreateApiInfo(new Dictionary<string, Uri>())
|
||||||
|
};
|
||||||
|
|
||||||
|
var gitHubClient = Substitute.For<IGitHubClient>();
|
||||||
|
|
||||||
|
gitHubClient.Connection.GetAsync<List<PullRequestReviewComment>>(firstPageUrl,
|
||||||
|
Arg.Is<Dictionary<string, string>>(d => d.Count == 2
|
||||||
|
&& d["direction"] == "asc"
|
||||||
|
&& d["sort"] == "created"), null)
|
||||||
|
.Returns(Task.Factory.StartNew<IResponse<List<PullRequestReviewComment>>>(() => firstPageResponse));
|
||||||
|
gitHubClient.Connection.GetAsync<List<PullRequestReviewComment>>(secondPageUrl, null, null)
|
||||||
|
.Returns(Task.Factory.StartNew<IResponse<List<PullRequestReviewComment>>>(() => secondPageResponse));
|
||||||
|
gitHubClient.Connection.GetAsync<List<PullRequestReviewComment>>(thirdPageUrl, null, null)
|
||||||
|
.Returns(Task.Factory.StartNew<IResponse<List<PullRequestReviewComment>>>(() => lastPageResponse));
|
||||||
|
|
||||||
|
var client = new ObservablePullRequestReviewCommentsClient(gitHubClient);
|
||||||
|
|
||||||
|
var results = await client.GetForRepository("fakeOwner", "fakeRepoName").ToArray();
|
||||||
|
|
||||||
|
Assert.Equal(8, results.Length);
|
||||||
|
gitHubClient.Connection.Received(1).GetAsync<List<PullRequestReviewComment>>(firstPageUrl,
|
||||||
|
Arg.Is<Dictionary<string, string>>(d => d.Count == 2
|
||||||
|
&& d["direction"] == "asc"
|
||||||
|
&& d["sort"] == "created"), null);
|
||||||
|
gitHubClient.Connection.Received(1).GetAsync<List<PullRequestReviewComment>>(secondPageUrl, null, null);
|
||||||
|
gitHubClient.Connection.Received(1).GetAsync<List<PullRequestReviewComment>>(thirdPageUrl, null, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public async Task EnsuresArgumentsNotNull()
|
||||||
|
{
|
||||||
|
var client = new ObservablePullRequestReviewCommentsClient(Substitute.For<IGitHubClient>());
|
||||||
|
|
||||||
|
var request = new PullRequestReviewCommentRequest();
|
||||||
|
|
||||||
|
await AssertEx.Throws<ArgumentNullException>(async () => await client.GetForRepository(null, "name", request));
|
||||||
|
await AssertEx.Throws<ArgumentException>(async () => await client.GetForRepository("", "name", request));
|
||||||
|
await AssertEx.Throws<ArgumentNullException>(async () => await client.GetForRepository("owner", null, request));
|
||||||
|
await AssertEx.Throws<ArgumentException>(async () => await client.GetForRepository("owner", "", request));
|
||||||
|
await AssertEx.Throws<ArgumentNullException>(async () => await client.GetForRepository("owner", "name", null));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public class TheGetCommentMethod
|
||||||
|
{
|
||||||
|
[Fact]
|
||||||
|
public void GetsFromClientPullRequestComment()
|
||||||
|
{
|
||||||
|
var gitHubClient = Substitute.For<IGitHubClient>();
|
||||||
|
var client = new ObservablePullRequestReviewCommentsClient(gitHubClient);
|
||||||
|
|
||||||
|
client.GetComment("fakeOwner", "fakeRepoName", 53);
|
||||||
|
|
||||||
|
gitHubClient.PullRequest.Comment.Received().GetComment("fakeOwner", "fakeRepoName", 53);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public async Task EnsuresArgumentsNonNull()
|
||||||
|
{
|
||||||
|
var client = new ObservablePullRequestReviewCommentsClient(Substitute.For<IGitHubClient>());
|
||||||
|
|
||||||
|
await AssertEx.Throws<ArgumentNullException>(async () => await client.GetComment(null, "name", 1));
|
||||||
|
await AssertEx.Throws<ArgumentException>(async () => await client.GetComment("", "name", 1));
|
||||||
|
await AssertEx.Throws<ArgumentNullException>(async () => await client.GetComment("owner", null, 1));
|
||||||
|
await AssertEx.Throws<ArgumentException>(async () => await client.GetComment("owner", "", 1));
|
||||||
|
await AssertEx.Throws<ArgumentNullException>(async () => await client.GetComment(null, null, 1));
|
||||||
|
await AssertEx.Throws<ArgumentException>(async () => await client.GetComment("", "", 1));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public class TheCreateMethod
|
||||||
|
{
|
||||||
|
[Fact]
|
||||||
|
public void PostsToCorrectUrl()
|
||||||
|
{
|
||||||
|
var gitHubClient = Substitute.For<IGitHubClient>();
|
||||||
|
var client = new ObservablePullRequestReviewCommentsClient(gitHubClient);
|
||||||
|
|
||||||
|
var comment = new PullRequestReviewCommentCreate
|
||||||
|
{
|
||||||
|
Body = "Comment content",
|
||||||
|
CommitId = "qe3dsdsf6",
|
||||||
|
Path = "file.css",
|
||||||
|
Position = 7,
|
||||||
|
};
|
||||||
|
|
||||||
|
client.Create("fakeOwner", "fakeRepoName", 13, comment);
|
||||||
|
|
||||||
|
gitHubClient.PullRequest.Comment.Received().Create("fakeOwner", "fakeRepoName", 13, comment);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public async Task EnsuresArgumentsNotNull()
|
||||||
|
{
|
||||||
|
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 = body,
|
||||||
|
CommitId = commitId,
|
||||||
|
Path = path,
|
||||||
|
Position = position,
|
||||||
|
};
|
||||||
|
|
||||||
|
await AssertEx.Throws<ArgumentNullException>(async () => await client.Create(null, "name", 1, comment));
|
||||||
|
await AssertEx.Throws<ArgumentException>(async () => await client.Create("", "name", 1, comment));
|
||||||
|
await AssertEx.Throws<ArgumentNullException>(async () => await client.Create("owner", null, 1, comment));
|
||||||
|
await AssertEx.Throws<ArgumentException>(async () => await client.Create("owner", "", 1, comment));
|
||||||
|
await AssertEx.Throws<ArgumentNullException>(async () => await client.Create("owner", "name", 1, null));
|
||||||
|
|
||||||
|
comment.Body = null;
|
||||||
|
await AssertEx.Throws<ArgumentNullException>(async () => await client.Create("owner", "name", 1, comment));
|
||||||
|
comment.Body = "";
|
||||||
|
await AssertEx.Throws<ArgumentException>(async () => await client.Create("owner", "name", 1, comment));
|
||||||
|
comment.Body = body;
|
||||||
|
|
||||||
|
comment.CommitId = null;
|
||||||
|
await AssertEx.Throws<ArgumentNullException>(async () => await client.Create("owner", "name", 1, comment));
|
||||||
|
comment.CommitId = "";
|
||||||
|
await AssertEx.Throws<ArgumentException>(async () => await client.Create("owner", "name", 1, comment));
|
||||||
|
comment.CommitId = commitId;
|
||||||
|
|
||||||
|
comment.Path = null;
|
||||||
|
await AssertEx.Throws<ArgumentNullException>(async () => await client.Create("owner", "name", 1, comment));
|
||||||
|
comment.Path = "";
|
||||||
|
await AssertEx.Throws<ArgumentException>(async () => await client.Create("owner", "name", 1, comment));
|
||||||
|
comment.Path = path;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public class TheCreateReplyMethod
|
||||||
|
{
|
||||||
|
[Fact]
|
||||||
|
public void PostsToCorrectUrl()
|
||||||
|
{
|
||||||
|
var gitHubClient = Substitute.For<IGitHubClient>();
|
||||||
|
var client = new ObservablePullRequestReviewCommentsClient(gitHubClient);
|
||||||
|
|
||||||
|
var comment = new PullRequestReviewCommentReplyCreate
|
||||||
|
{
|
||||||
|
Body = "Comment content",
|
||||||
|
InReplyTo = 9,
|
||||||
|
};
|
||||||
|
|
||||||
|
client.CreateReply("fakeOwner", "fakeRepoName", 13, comment);
|
||||||
|
|
||||||
|
gitHubClient.PullRequest.Comment.Received().CreateReply("fakeOwner", "fakeRepoName", 13, comment);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
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 = body,
|
||||||
|
InReplyTo = 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));
|
||||||
|
|
||||||
|
comment.Body = null;
|
||||||
|
await AssertEx.Throws<ArgumentNullException>(async () => await client.CreateReply("owner", "name", 1, comment));
|
||||||
|
comment.Body = "";
|
||||||
|
await AssertEx.Throws<ArgumentException>(async () => await client.CreateReply("owner", "name", 1, comment));
|
||||||
|
comment.Body = body;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public class TheEditMethod
|
||||||
|
{
|
||||||
|
[Fact]
|
||||||
|
public void PostsToCorrectUrl()
|
||||||
|
{
|
||||||
|
var gitHubClient = Substitute.For<IGitHubClient>();
|
||||||
|
var client = new ObservablePullRequestReviewCommentsClient(gitHubClient);
|
||||||
|
|
||||||
|
var comment = new PullRequestReviewCommentEdit
|
||||||
|
{
|
||||||
|
Body = "New comment content",
|
||||||
|
};
|
||||||
|
|
||||||
|
client.Edit("fakeOwner", "fakeRepoName", 13, comment);
|
||||||
|
|
||||||
|
gitHubClient.PullRequest.Comment.Received().Edit("fakeOwner", "fakeRepoName", 13, comment);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public async Task EnsuresArgumentsNotNull()
|
||||||
|
{
|
||||||
|
var gitHubClient = Substitute.For<IGitHubClient>();
|
||||||
|
var client = new ObservablePullRequestReviewCommentsClient(gitHubClient);
|
||||||
|
|
||||||
|
var body = "New comment content";
|
||||||
|
|
||||||
|
var comment = new PullRequestReviewCommentEdit
|
||||||
|
{
|
||||||
|
Body = body,
|
||||||
|
};
|
||||||
|
|
||||||
|
await AssertEx.Throws<ArgumentNullException>(async () => await client.Edit(null, "name", 1, comment));
|
||||||
|
await AssertEx.Throws<ArgumentException>(async () => await client.Edit("", "name", 1, comment));
|
||||||
|
await AssertEx.Throws<ArgumentNullException>(async () => await client.Edit("owner", null, 1, comment));
|
||||||
|
await AssertEx.Throws<ArgumentException>(async () => await client.Edit("owner", "", 1, comment));
|
||||||
|
await AssertEx.Throws<ArgumentNullException>(async () => await client.Edit("owner", "name", 1, null));
|
||||||
|
|
||||||
|
comment.Body = null;
|
||||||
|
await AssertEx.Throws<ArgumentNullException>(async () => await client.Edit("owner", "name", 1, comment));
|
||||||
|
comment.Body = "";
|
||||||
|
await AssertEx.Throws<ArgumentException>(async () => await client.Edit("owner", "name", 1, comment));
|
||||||
|
comment.Body = body;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public class TheDeleteMethod
|
||||||
|
{
|
||||||
|
[Fact]
|
||||||
|
public void PostsToCorrectUrl()
|
||||||
|
{
|
||||||
|
var gitHubClient = Substitute.For<IGitHubClient>();
|
||||||
|
var client = new ObservablePullRequestReviewCommentsClient(gitHubClient);
|
||||||
|
|
||||||
|
client.Delete("fakeOwner", "fakeRepoName", 13);
|
||||||
|
|
||||||
|
gitHubClient.PullRequest.Comment.Received().Delete("fakeOwner", "fakeRepoName", 13);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public async Task EnsuresArgumentsNotNull()
|
||||||
|
{
|
||||||
|
var gitHubClient = Substitute.For<IGitHubClient>();
|
||||||
|
var client = new ObservablePullRequestReviewCommentsClient(gitHubClient);
|
||||||
|
|
||||||
|
await AssertEx.Throws<ArgumentNullException>(async () => await client.Delete(null, "name", 1));
|
||||||
|
await AssertEx.Throws<ArgumentException>(async () => await client.Delete("", "name", 1));
|
||||||
|
await AssertEx.Throws<ArgumentNullException>(async () => await client.Delete("owner", null, 1));
|
||||||
|
await AssertEx.Throws<ArgumentException>(async () => await client.Delete("owner", "", 1));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
90
Octokit/Clients/IPullRequestReviewCommentsClient.cs
Normal file
90
Octokit/Clients/IPullRequestReviewCommentsClient.cs
Normal file
@@ -0,0 +1,90 @@
|
|||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace Octokit
|
||||||
|
{
|
||||||
|
public interface IPullRequestReviewCommentsClient
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Gets review comments for a specified pull request.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>http://developer.github.com/v3/pulls/comments/#list-comments-on-a-pull-request</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>
|
||||||
|
/// <returns>The list of <see cref="PullRequestReviewComment"/>s for the specified pull request</returns>
|
||||||
|
Task<IReadOnlyList<PullRequestReviewComment>> GetForPullRequest(string owner, string name, int number);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets a list of the pull request review comments in a specified repository.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>http://developer.github.com/v3/pulls/comments/#list-comments-in-a-repository</remarks>
|
||||||
|
/// <param name="owner">The owner of the repository</param>
|
||||||
|
/// <param name="name">The name of the repository</param>
|
||||||
|
/// <returns>The list of <see cref="PullRequestReviewComment"/>s for the specified repository</returns>
|
||||||
|
Task<IReadOnlyList<PullRequestReviewComment>> GetForRepository(string owner, string name);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets a list of the pull request review comments in a specified repository.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>http://developer.github.com/v3/pulls/comments/#list-comments-in-a-repository</remarks>
|
||||||
|
/// <param name="owner">The owner of the repository</param>
|
||||||
|
/// <param name="name">The name of the repository</param>
|
||||||
|
/// <param name="request">The sorting <see cref="PullRequestReviewCommentRequest">parameters</see></param>
|
||||||
|
/// <returns>The list of <see cref="PullRequestReviewComment"/>s for the specified repository</returns>
|
||||||
|
Task<IReadOnlyList<PullRequestReviewComment>> GetForRepository(string owner, string name, PullRequestReviewCommentRequest request);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets a single pull request review comment by number.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>http://developer.github.com/v3/pulls/comments/#get-a-single-comment</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 review comment number</param>
|
||||||
|
/// <returns>The <see cref="PullRequestReviewComment"/></returns>
|
||||||
|
Task<PullRequestReviewComment> GetComment(string owner, string name, int number);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Creates a comment on a pull request review.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>http://developer.github.com/v3/pulls/comments/#create-a-comment</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="comment">The comment</param>
|
||||||
|
/// <returns>The created <see cref="PullRequestReviewComment"/></returns>
|
||||||
|
Task<PullRequestReviewComment> Create(string owner, string name, int number, PullRequestReviewCommentCreate comment);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Creates a comment on a pull request review as a reply to another comment.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>http://developer.github.com/v3/pulls/comments/#create-a-comment</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="comment">The comment</param>
|
||||||
|
/// <returns>The created <see cref="PullRequestReviewComment"/></returns>
|
||||||
|
Task<PullRequestReviewComment> CreateReply(string owner, string name, int number, PullRequestReviewCommentReplyCreate comment);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Edits a comment on a pull request review.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>http://developer.github.com/v3/pulls/comments/#edit-a-comment</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 review comment number</param>
|
||||||
|
/// <param name="comment">The edited comment</param>
|
||||||
|
/// <returns>The edited <see cref="PullRequestReviewComment"/></returns>
|
||||||
|
Task<PullRequestReviewComment> Edit(string owner, string name, int number, PullRequestReviewCommentEdit comment);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Deletes a comment on a pull request review.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>http://developer.github.com/v3/pulls/comments/#delete-a-comment</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 review comment number</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task Delete(string owner, string name, int number);
|
||||||
|
}
|
||||||
|
}
|
||||||
11
Octokit/Clients/IPullRequestsClient.cs
Normal file
11
Octokit/Clients/IPullRequestsClient.cs
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
|
||||||
|
namespace Octokit
|
||||||
|
{
|
||||||
|
public interface IPullRequestsClient
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Client for managing comments.
|
||||||
|
/// </summary>
|
||||||
|
IPullRequestReviewCommentsClient Comment { get; }
|
||||||
|
}
|
||||||
|
}
|
||||||
149
Octokit/Clients/PullRequestReviewCommentsClient.cs
Normal file
149
Octokit/Clients/PullRequestReviewCommentsClient.cs
Normal file
@@ -0,0 +1,149 @@
|
|||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace Octokit
|
||||||
|
{
|
||||||
|
public class PullRequestReviewCommentsClient : ApiClient, IPullRequestReviewCommentsClient
|
||||||
|
{
|
||||||
|
public PullRequestReviewCommentsClient(IApiConnection apiConnection)
|
||||||
|
: base(apiConnection)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets review comments for a specified pull request.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>http://developer.github.com/v3/pulls/comments/#list-comments-on-a-pull-request</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>
|
||||||
|
/// <returns>The list of <see cref="PullRequestReviewComment"/>s for the specified pull request</returns>
|
||||||
|
public Task<IReadOnlyList<PullRequestReviewComment>> GetForPullRequest(string owner, string name, int number)
|
||||||
|
{
|
||||||
|
Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
|
||||||
|
Ensure.ArgumentNotNullOrEmptyString(name, "name");
|
||||||
|
|
||||||
|
return ApiConnection.GetAll<PullRequestReviewComment>(ApiUrls.PullRequestReviewComments(owner, name, number));
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets a list of the pull request review comments in a specified repository.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>http://developer.github.com/v3/pulls/comments/#list-comments-in-a-repository</remarks>
|
||||||
|
/// <param name="owner">The owner of the repository</param>
|
||||||
|
/// <param name="name">The name of the repository</param>
|
||||||
|
/// <returns>The list of <see cref="PullRequestReviewComment"/>s for the specified repository</returns>
|
||||||
|
public Task<IReadOnlyList<PullRequestReviewComment>> GetForRepository(string owner, string name)
|
||||||
|
{
|
||||||
|
return GetForRepository(owner, name, new PullRequestReviewCommentRequest());
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets a list of the pull request review comments in a specified repository.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>http://developer.github.com/v3/pulls/comments/#list-comments-in-a-repository</remarks>
|
||||||
|
/// <param name="owner">The owner of the repository</param>
|
||||||
|
/// <param name="name">The name of the repository</param>
|
||||||
|
/// <param name="request">The sorting <see cref="PullRequestReviewCommentRequest">parameters</see></param>
|
||||||
|
/// <returns>The list of <see cref="PullRequestReviewComment"/>s for the specified repository</returns>
|
||||||
|
public Task<IReadOnlyList<PullRequestReviewComment>> GetForRepository(string owner, string name, PullRequestReviewCommentRequest request)
|
||||||
|
{
|
||||||
|
Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
|
||||||
|
Ensure.ArgumentNotNullOrEmptyString(name, "name");
|
||||||
|
Ensure.ArgumentNotNull(request, "request");
|
||||||
|
|
||||||
|
return ApiConnection.GetAll<PullRequestReviewComment>(ApiUrls.PullRequestReviewCommentsRepository(owner, name), request.ToParametersDictionary());
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets a single pull request review comment by number.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>http://developer.github.com/v3/pulls/comments/#get-a-single-comment</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 review comment number</param>
|
||||||
|
/// <returns>The <see cref="PullRequestReviewComment"/></returns>
|
||||||
|
public Task<PullRequestReviewComment> GetComment(string owner, string name, int number)
|
||||||
|
{
|
||||||
|
Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
|
||||||
|
Ensure.ArgumentNotNullOrEmptyString(name, "name");
|
||||||
|
|
||||||
|
return ApiConnection.Get<PullRequestReviewComment>(ApiUrls.PullRequestReviewComment(owner, name, number));
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Creates a comment on a pull request review.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>http://developer.github.com/v3/pulls/comments/#create-a-comment</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="comment">The comment</param>
|
||||||
|
/// <returns>The created <see cref="PullRequestReviewComment"/></returns>
|
||||||
|
public Task<PullRequestReviewComment> Create(string owner, string name, int number, PullRequestReviewCommentCreate comment)
|
||||||
|
{
|
||||||
|
Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
|
||||||
|
Ensure.ArgumentNotNullOrEmptyString(name, "name");
|
||||||
|
Ensure.ArgumentNotNull(comment, "comment");
|
||||||
|
Ensure.ArgumentNotNullOrEmptyString(comment.Body, "body");
|
||||||
|
Ensure.ArgumentNotNullOrEmptyString(comment.CommitId, "commitId");
|
||||||
|
Ensure.ArgumentNotNullOrEmptyString(comment.Path, "path");
|
||||||
|
|
||||||
|
return ApiConnection.Post<PullRequestReviewComment>(ApiUrls.PullRequestReviewComments(owner, name, number), comment);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Creates a comment on a pull request review as a reply to another comment.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>http://developer.github.com/v3/pulls/comments/#create-a-comment</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="comment">The comment</param>
|
||||||
|
/// <returns>The created <see cref="PullRequestReviewComment"/></returns>
|
||||||
|
public Task<PullRequestReviewComment> CreateReply(string owner, string name, int number, PullRequestReviewCommentReplyCreate comment)
|
||||||
|
{
|
||||||
|
Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
|
||||||
|
Ensure.ArgumentNotNullOrEmptyString(name, "name");
|
||||||
|
Ensure.ArgumentNotNull(comment, "comment");
|
||||||
|
Ensure.ArgumentNotNullOrEmptyString(comment.Body, "body");
|
||||||
|
|
||||||
|
return ApiConnection.Post<PullRequestReviewComment>(ApiUrls.PullRequestReviewComments(owner, name, number), comment);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Edits a comment on a pull request review.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>http://developer.github.com/v3/pulls/comments/#edit-a-comment</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 review comment number</param>
|
||||||
|
/// <param name="comment">The edited comment</param>
|
||||||
|
/// <returns>The edited <see cref="PullRequestReviewComment"/></returns>
|
||||||
|
public Task<PullRequestReviewComment> Edit(string owner, string name, int number, PullRequestReviewCommentEdit comment)
|
||||||
|
{
|
||||||
|
Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
|
||||||
|
Ensure.ArgumentNotNullOrEmptyString(name, "name");
|
||||||
|
Ensure.ArgumentNotNull(comment, "comment");
|
||||||
|
Ensure.ArgumentNotNullOrEmptyString(comment.Body, "body");
|
||||||
|
|
||||||
|
return ApiConnection.Patch<PullRequestReviewComment>(ApiUrls.PullRequestReviewComment(owner, name, number), comment);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Deletes a comment on a pull request review.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>http://developer.github.com/v3/pulls/comments/#delete-a-comment</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 review comment number</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public Task Delete(string owner, string name, int number)
|
||||||
|
{
|
||||||
|
Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
|
||||||
|
Ensure.ArgumentNotNullOrEmptyString(name, "name");
|
||||||
|
|
||||||
|
return ApiConnection.Delete(ApiUrls.PullRequestReviewComment(owner, name, number));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
16
Octokit/Clients/PullRequestsClient.cs
Normal file
16
Octokit/Clients/PullRequestsClient.cs
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
|
||||||
|
namespace Octokit
|
||||||
|
{
|
||||||
|
public class PullRequestsClient : ApiClient, IPullRequestsClient
|
||||||
|
{
|
||||||
|
public PullRequestsClient(IApiConnection apiConnection) : base(apiConnection)
|
||||||
|
{
|
||||||
|
Comment = new PullRequestReviewCommentsClient(apiConnection);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Client for managing comments.
|
||||||
|
/// </summary>
|
||||||
|
public IPullRequestReviewCommentsClient Comment { get; private set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -85,6 +85,7 @@ namespace Octokit
|
|||||||
Miscellaneous = new MiscellaneousClient(connection);
|
Miscellaneous = new MiscellaneousClient(connection);
|
||||||
Notification = new NotificationsClient(apiConnection);
|
Notification = new NotificationsClient(apiConnection);
|
||||||
Organization = new OrganizationsClient(apiConnection);
|
Organization = new OrganizationsClient(apiConnection);
|
||||||
|
PullRequest = new PullRequestsClient(apiConnection);
|
||||||
Repository = new RepositoriesClient(apiConnection);
|
Repository = new RepositoriesClient(apiConnection);
|
||||||
Release = new ReleasesClient(apiConnection);
|
Release = new ReleasesClient(apiConnection);
|
||||||
User = new UsersClient(apiConnection);
|
User = new UsersClient(apiConnection);
|
||||||
@@ -131,6 +132,7 @@ namespace Octokit
|
|||||||
public IIssuesClient Issue { get; private set; }
|
public IIssuesClient Issue { get; private set; }
|
||||||
public IMiscellaneousClient Miscellaneous { get; private set; }
|
public IMiscellaneousClient Miscellaneous { get; private set; }
|
||||||
public IOrganizationsClient Organization { get; private set; }
|
public IOrganizationsClient Organization { get; private set; }
|
||||||
|
public IPullRequestsClient PullRequest { get; private set; }
|
||||||
public IRepositoriesClient Repository { get; private set; }
|
public IRepositoriesClient Repository { get; private set; }
|
||||||
public IReleasesClient Release { get; private set; }
|
public IReleasesClient Release { get; private set; }
|
||||||
public ISshKeysClient SshKey { get; private set; }
|
public ISshKeysClient SshKey { get; private set; }
|
||||||
|
|||||||
@@ -548,5 +548,40 @@ namespace Octokit
|
|||||||
{
|
{
|
||||||
return "users/{0}/events/orgs/{1}".FormatUri(user, organization);
|
return "users/{0}/events/orgs/{1}".FormatUri(user, organization);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns the <see cref="Uri"/> for the comments of a specified pull request review.
|
||||||
|
/// </summary>
|
||||||
|
/// <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>
|
||||||
|
/// <returns>The <see cref="Uri"/></returns>
|
||||||
|
public static Uri PullRequestReviewComments(string owner, string name, int number)
|
||||||
|
{
|
||||||
|
return "repos/{0}/{1}/pulls/{2}/comments".FormatUri(owner, name, number);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns the <see cref="Uri"/> for the specified pull request review comment.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="owner">The owner of the repository</param>
|
||||||
|
/// <param name="name">The name of the repository</param>
|
||||||
|
/// <param name="number">The comment number</param>
|
||||||
|
/// <returns>The <see cref="Uri"/></returns>
|
||||||
|
public static Uri PullRequestReviewComment(string owner, string name, int number)
|
||||||
|
{
|
||||||
|
return "repos/{0}/{1}/pulls/comments/{2}".FormatUri(owner, name, number);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns the <see cref="Uri"/> for the pull request review comments on a specified repository.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="owner">The owner of the repository</param>
|
||||||
|
/// <param name="name">The name of the repository</param>
|
||||||
|
/// <returns>The <see cref="Uri"/></returns>
|
||||||
|
public static Uri PullRequestReviewCommentsRepository(string owner, string name)
|
||||||
|
{
|
||||||
|
return "repos/{0}/{1}/pulls/comments".FormatUri(owner, name);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ namespace Octokit
|
|||||||
IIssuesClient Issue { get; }
|
IIssuesClient Issue { get; }
|
||||||
IMiscellaneousClient Miscellaneous { get; }
|
IMiscellaneousClient Miscellaneous { get; }
|
||||||
IOrganizationsClient Organization { get; }
|
IOrganizationsClient Organization { get; }
|
||||||
|
IPullRequestsClient PullRequest { get; }
|
||||||
IRepositoriesClient Repository { get; }
|
IRepositoriesClient Repository { get; }
|
||||||
IReleasesClient Release { get; }
|
IReleasesClient Release { get; }
|
||||||
ISshKeysClient SshKey { get; }
|
ISshKeysClient SshKey { get; }
|
||||||
|
|||||||
28
Octokit/Models/Request/PullRequestReviewCommentCreate.cs
Normal file
28
Octokit/Models/Request/PullRequestReviewCommentCreate.cs
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
using Octokit.Internal;
|
||||||
|
|
||||||
|
namespace Octokit
|
||||||
|
{
|
||||||
|
public class PullRequestReviewCommentCreate : RequestParameters
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The text of the comment.
|
||||||
|
/// </summary>
|
||||||
|
public string Body { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The SHA of the commit to comment on.
|
||||||
|
/// </summary>
|
||||||
|
[Parameter(Key = "commit_id")]
|
||||||
|
public string CommitId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The relative path of the file to comment on.
|
||||||
|
/// </summary>
|
||||||
|
public string Path { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The line index in the diff to comment on.
|
||||||
|
/// </summary>
|
||||||
|
public int Position { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
11
Octokit/Models/Request/PullRequestReviewCommentEdit.cs
Normal file
11
Octokit/Models/Request/PullRequestReviewCommentEdit.cs
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
|
||||||
|
namespace Octokit
|
||||||
|
{
|
||||||
|
public class PullRequestReviewCommentEdit : RequestParameters
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The text of the comment.
|
||||||
|
/// </summary>
|
||||||
|
public string Body { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
using Octokit.Internal;
|
||||||
|
|
||||||
|
namespace Octokit
|
||||||
|
{
|
||||||
|
public class PullRequestReviewCommentReplyCreate : RequestParameters
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The text of the comment.
|
||||||
|
/// </summary>
|
||||||
|
public string Body { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The comment Id to reply to.
|
||||||
|
/// </summary>
|
||||||
|
[Parameter(Key = "in_reply_to")]
|
||||||
|
public int InReplyTo { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
31
Octokit/Models/Request/PullRequestReviewCommentRequest.cs
Normal file
31
Octokit/Models/Request/PullRequestReviewCommentRequest.cs
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
using System;
|
||||||
|
|
||||||
|
namespace Octokit
|
||||||
|
{
|
||||||
|
public class PullRequestReviewCommentRequest : RequestParameters
|
||||||
|
{
|
||||||
|
public PullRequestReviewCommentRequest()
|
||||||
|
{
|
||||||
|
// Default arguments
|
||||||
|
|
||||||
|
Sort = PullRequestReviewCommentSort.Created;
|
||||||
|
Direction = SortDirection.Ascending;
|
||||||
|
Since = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Can be either created or updated. Default: created.
|
||||||
|
/// </summary>
|
||||||
|
public PullRequestReviewCommentSort Sort { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Can be either asc or desc. Default: asc.
|
||||||
|
/// </summary>
|
||||||
|
public SortDirection Direction { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Only comments updated at or after this time are returned. This is a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ.
|
||||||
|
/// </summary>
|
||||||
|
public DateTimeOffset? Since { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
118
Octokit/Models/Response/PullRequestReviewComment.cs
Normal file
118
Octokit/Models/Response/PullRequestReviewComment.cs
Normal file
@@ -0,0 +1,118 @@
|
|||||||
|
using System;
|
||||||
|
|
||||||
|
namespace Octokit
|
||||||
|
{
|
||||||
|
public class PullRequestReviewComment
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// URL of the comment via the API.
|
||||||
|
/// </summary>
|
||||||
|
public Uri Url { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The comment Id.
|
||||||
|
/// </summary>
|
||||||
|
public int Id { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The diff hunk the comment is about.
|
||||||
|
/// </summary>
|
||||||
|
public string DiffHunk { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The relative path of the file the comment is about.
|
||||||
|
/// </summary>
|
||||||
|
public string Path { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The line index in the diff.
|
||||||
|
/// </summary>
|
||||||
|
public int? Position { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The comment original position.
|
||||||
|
/// </summary>
|
||||||
|
public int? OriginalPosition { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The commit Id the comment is associated with.
|
||||||
|
/// </summary>
|
||||||
|
public string CommitId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The original commit Id the comment is associated with.
|
||||||
|
/// </summary>
|
||||||
|
public string OriginalCommitId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The user that created the comment.
|
||||||
|
/// </summary>
|
||||||
|
public User User { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The text of the comment.
|
||||||
|
/// </summary>
|
||||||
|
public string Body { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The date the comment was created.
|
||||||
|
/// </summary>
|
||||||
|
public DateTimeOffset CreatedAt { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The date the comment was last updated.
|
||||||
|
/// </summary>
|
||||||
|
public DateTimeOffset UpdatedAt { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The URL for this comment on Github.com
|
||||||
|
/// </summary>
|
||||||
|
public Uri HtmlUrl { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The URL for the pull request via the API.
|
||||||
|
/// </summary>
|
||||||
|
public Uri PullRequestUrl { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Contains Url, HtmlUrl and PullRequestUrl
|
||||||
|
/// </summary>
|
||||||
|
public PullRequestReviewCommentLinks Links { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class PullRequestReviewCommentLinks
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// URL of the comment via the API.
|
||||||
|
/// </summary>
|
||||||
|
public PullRequestReviewCommentLink Self { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The URL for this comment on Github.com
|
||||||
|
/// </summary>
|
||||||
|
public PullRequestReviewCommentLink Html { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The URL for the pull request via the API.
|
||||||
|
/// </summary>
|
||||||
|
public PullRequestReviewCommentLink PullRequest { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class PullRequestReviewCommentLink
|
||||||
|
{
|
||||||
|
public Uri Href { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public enum PullRequestReviewCommentSort
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Sort by create date (default)
|
||||||
|
/// </summary>
|
||||||
|
Created,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Sort by the date of the last update
|
||||||
|
/// </summary>
|
||||||
|
Updated,
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -48,6 +48,14 @@
|
|||||||
<Compile Include="Clients\GitDatabaseClient.cs" />
|
<Compile Include="Clients\GitDatabaseClient.cs" />
|
||||||
<Compile Include="Clients\ICommitsClient.cs" />
|
<Compile Include="Clients\ICommitsClient.cs" />
|
||||||
<Compile Include="Clients\IActivitiesClient.cs" />
|
<Compile Include="Clients\IActivitiesClient.cs" />
|
||||||
|
<Compile Include="Clients\IPullRequestReviewCommentsClient.cs" />
|
||||||
|
<Compile Include="Clients\IPullRequestsClient.cs" />
|
||||||
|
<Compile Include="Clients\PullRequestReviewCommentsClient.cs" />
|
||||||
|
<Compile Include="Models\Request\PullRequestReviewCommentCreate.cs" />
|
||||||
|
<Compile Include="Models\Request\PullRequestReviewCommentEdit.cs" />
|
||||||
|
<Compile Include="Models\Request\PullRequestReviewCommentReplyCreate.cs" />
|
||||||
|
<Compile Include="Models\Request\PullRequestReviewCommentRequest.cs" />
|
||||||
|
<Compile Include="Clients\PullRequestsClient.cs" />
|
||||||
<Compile Include="Clients\ICommitStatusClient.cs" />
|
<Compile Include="Clients\ICommitStatusClient.cs" />
|
||||||
<Compile Include="Clients\IEventsClient.cs" />
|
<Compile Include="Clients\IEventsClient.cs" />
|
||||||
<Compile Include="Clients\IGitDatabaseClient.cs" />
|
<Compile Include="Clients\IGitDatabaseClient.cs" />
|
||||||
@@ -104,6 +112,7 @@
|
|||||||
<Compile Include="Models\Response\TagObject.cs" />
|
<Compile Include="Models\Response\TagObject.cs" />
|
||||||
<Compile Include="Models\Response\Team.cs" />
|
<Compile Include="Models\Response\Team.cs" />
|
||||||
<Compile Include="Models\Response\TeamItem.cs" />
|
<Compile Include="Models\Response\TeamItem.cs" />
|
||||||
|
<Compile Include="Models\Response\PullRequestReviewComment.cs" />
|
||||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
<Compile Include="Exceptions\TwoFactorChallengeFailedException.cs" />
|
<Compile Include="Exceptions\TwoFactorChallengeFailedException.cs" />
|
||||||
<Compile Include="Exceptions\TwoFactorRequiredException.cs" />
|
<Compile Include="Exceptions\TwoFactorRequiredException.cs" />
|
||||||
|
|||||||
@@ -58,6 +58,14 @@
|
|||||||
<Compile Include="Clients\GitDatabaseClient.cs" />
|
<Compile Include="Clients\GitDatabaseClient.cs" />
|
||||||
<Compile Include="Clients\ICommitsClient.cs" />
|
<Compile Include="Clients\ICommitsClient.cs" />
|
||||||
<Compile Include="Clients\IActivitiesClient.cs" />
|
<Compile Include="Clients\IActivitiesClient.cs" />
|
||||||
|
<Compile Include="Clients\IPullRequestReviewCommentsClient.cs" />
|
||||||
|
<Compile Include="Clients\IPullRequestsClient.cs" />
|
||||||
|
<Compile Include="Clients\PullRequestReviewCommentsClient.cs" />
|
||||||
|
<Compile Include="Models\Request\PullRequestReviewCommentCreate.cs" />
|
||||||
|
<Compile Include="Models\Request\PullRequestReviewCommentEdit.cs" />
|
||||||
|
<Compile Include="Models\Request\PullRequestReviewCommentReplyCreate.cs" />
|
||||||
|
<Compile Include="Models\Request\PullRequestReviewCommentRequest.cs" />
|
||||||
|
<Compile Include="Clients\PullRequestsClient.cs" />
|
||||||
<Compile Include="Clients\ICommitStatusClient.cs" />
|
<Compile Include="Clients\ICommitStatusClient.cs" />
|
||||||
<Compile Include="Clients\IEventsClient.cs" />
|
<Compile Include="Clients\IEventsClient.cs" />
|
||||||
<Compile Include="Clients\IGitDatabaseClient.cs" />
|
<Compile Include="Clients\IGitDatabaseClient.cs" />
|
||||||
@@ -103,6 +111,7 @@
|
|||||||
<Compile Include="Models\Request\RepositoryIssueRequest.cs" />
|
<Compile Include="Models\Request\RepositoryIssueRequest.cs" />
|
||||||
<Compile Include="Models\Request\MilestoneRequest.cs" />
|
<Compile Include="Models\Request\MilestoneRequest.cs" />
|
||||||
<Compile Include="Models\Response\TagObject.cs" />
|
<Compile Include="Models\Response\TagObject.cs" />
|
||||||
|
<Compile Include="Models\Response\PullRequestReviewComment.cs" />
|
||||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
<Compile Include="Exceptions\TwoFactorChallengeFailedException.cs" />
|
<Compile Include="Exceptions\TwoFactorChallengeFailedException.cs" />
|
||||||
<Compile Include="Exceptions\TwoFactorRequiredException.cs" />
|
<Compile Include="Exceptions\TwoFactorRequiredException.cs" />
|
||||||
|
|||||||
@@ -53,6 +53,14 @@
|
|||||||
<Compile Include="Clients\GitDatabaseClient.cs" />
|
<Compile Include="Clients\GitDatabaseClient.cs" />
|
||||||
<Compile Include="Clients\ICommitsClient.cs" />
|
<Compile Include="Clients\ICommitsClient.cs" />
|
||||||
<Compile Include="Clients\IActivitiesClient.cs" />
|
<Compile Include="Clients\IActivitiesClient.cs" />
|
||||||
|
<Compile Include="Clients\IPullRequestReviewCommentsClient.cs" />
|
||||||
|
<Compile Include="Clients\IPullRequestsClient.cs" />
|
||||||
|
<Compile Include="Clients\PullRequestReviewCommentsClient.cs" />
|
||||||
|
<Compile Include="Models\Request\PullRequestReviewCommentCreate.cs" />
|
||||||
|
<Compile Include="Models\Request\PullRequestReviewCommentEdit.cs" />
|
||||||
|
<Compile Include="Models\Request\PullRequestReviewCommentReplyCreate.cs" />
|
||||||
|
<Compile Include="Models\Request\PullRequestReviewCommentRequest.cs" />
|
||||||
|
<Compile Include="Clients\PullRequestsClient.cs" />
|
||||||
<Compile Include="Clients\ICommitStatusClient.cs" />
|
<Compile Include="Clients\ICommitStatusClient.cs" />
|
||||||
<Compile Include="Clients\IEventsClient.cs" />
|
<Compile Include="Clients\IEventsClient.cs" />
|
||||||
<Compile Include="Clients\IGitDatabaseClient.cs" />
|
<Compile Include="Clients\IGitDatabaseClient.cs" />
|
||||||
@@ -98,6 +106,7 @@
|
|||||||
<Compile Include="Models\Request\RepositoryIssueRequest.cs" />
|
<Compile Include="Models\Request\RepositoryIssueRequest.cs" />
|
||||||
<Compile Include="Models\Request\MilestoneRequest.cs" />
|
<Compile Include="Models\Request\MilestoneRequest.cs" />
|
||||||
<Compile Include="Models\Response\TagObject.cs" />
|
<Compile Include="Models\Response\TagObject.cs" />
|
||||||
|
<Compile Include="Models\Response\PullRequestReviewComment.cs" />
|
||||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
<Compile Include="Exceptions\TwoFactorChallengeFailedException.cs" />
|
<Compile Include="Exceptions\TwoFactorChallengeFailedException.cs" />
|
||||||
<Compile Include="Exceptions\TwoFactorRequiredException.cs" />
|
<Compile Include="Exceptions\TwoFactorRequiredException.cs" />
|
||||||
|
|||||||
@@ -58,6 +58,10 @@
|
|||||||
<Compile Include="Clients\EventsClient.cs" />
|
<Compile Include="Clients\EventsClient.cs" />
|
||||||
<Compile Include="Clients\GitDatabaseClient.cs" />
|
<Compile Include="Clients\GitDatabaseClient.cs" />
|
||||||
<Compile Include="Clients\IActivitiesClient.cs" />
|
<Compile Include="Clients\IActivitiesClient.cs" />
|
||||||
|
<Compile Include="Clients\IPullRequestReviewCommentsClient.cs" />
|
||||||
|
<Compile Include="Clients\IPullRequestsClient.cs" />
|
||||||
|
<Compile Include="Clients\PullRequestReviewCommentsClient.cs" />
|
||||||
|
<Compile Include="Clients\PullRequestsClient.cs" />
|
||||||
<Compile Include="Clients\IAssigneesClient.cs" />
|
<Compile Include="Clients\IAssigneesClient.cs" />
|
||||||
<Compile Include="Clients\IAuthorizationsClient.cs" />
|
<Compile Include="Clients\IAuthorizationsClient.cs" />
|
||||||
<Compile Include="Clients\ICommitsClient.cs" />
|
<Compile Include="Clients\ICommitsClient.cs" />
|
||||||
@@ -200,6 +204,11 @@
|
|||||||
<Compile Include="Models\Response\Team.cs" />
|
<Compile Include="Models\Response\Team.cs" />
|
||||||
<Compile Include="Models\Response\TeamItem.cs" />
|
<Compile Include="Models\Response\TeamItem.cs" />
|
||||||
<Compile Include="Models\Response\User.cs" />
|
<Compile Include="Models\Response\User.cs" />
|
||||||
|
<Compile Include="Models\Response\PullRequestReviewComment.cs" />
|
||||||
|
<Compile Include="Models\Request\PullRequestReviewCommentCreate.cs" />
|
||||||
|
<Compile Include="Models\Request\PullRequestReviewCommentEdit.cs" />
|
||||||
|
<Compile Include="Models\Request\PullRequestReviewCommentReplyCreate.cs" />
|
||||||
|
<Compile Include="Models\Request\PullRequestReviewCommentRequest.cs" />
|
||||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
<Compile Include="Helpers\StringExtensions.cs" />
|
<Compile Include="Helpers\StringExtensions.cs" />
|
||||||
<Compile Include="SimpleJson.cs" />
|
<Compile Include="SimpleJson.cs" />
|
||||||
|
|||||||
@@ -55,6 +55,14 @@
|
|||||||
<Compile Include="Clients\ActivitiesClient.cs" />
|
<Compile Include="Clients\ActivitiesClient.cs" />
|
||||||
<Compile Include="Clients\EventsClient.cs" />
|
<Compile Include="Clients\EventsClient.cs" />
|
||||||
<Compile Include="Clients\IActivitiesClient.cs" />
|
<Compile Include="Clients\IActivitiesClient.cs" />
|
||||||
|
<Compile Include="Clients\IPullRequestReviewCommentsClient.cs" />
|
||||||
|
<Compile Include="Clients\IPullRequestsClient.cs" />
|
||||||
|
<Compile Include="Clients\PullRequestReviewCommentsClient.cs" />
|
||||||
|
<Compile Include="Clients\PullRequestsClient.cs" />
|
||||||
|
<Compile Include="Models\Request\PullRequestReviewCommentCreate.cs" />
|
||||||
|
<Compile Include="Models\Request\PullRequestReviewCommentEdit.cs" />
|
||||||
|
<Compile Include="Models\Request\PullRequestReviewCommentReplyCreate.cs" />
|
||||||
|
<Compile Include="Models\Request\PullRequestReviewCommentRequest.cs" />
|
||||||
<Compile Include="Models\Response\Activity.cs" />
|
<Compile Include="Models\Response\Activity.cs" />
|
||||||
<Compile Include="Clients\AssigneesClient.cs" />
|
<Compile Include="Clients\AssigneesClient.cs" />
|
||||||
<Compile Include="Clients\CommitsClient.cs" />
|
<Compile Include="Clients\CommitsClient.cs" />
|
||||||
@@ -95,6 +103,7 @@
|
|||||||
<Compile Include="Models\Response\Commit.cs" />
|
<Compile Include="Models\Response\Commit.cs" />
|
||||||
<Compile Include="Models\Response\CommitStatus.cs" />
|
<Compile Include="Models\Response\CommitStatus.cs" />
|
||||||
<Compile Include="Models\Request\Permission.cs" />
|
<Compile Include="Models\Request\Permission.cs" />
|
||||||
|
<Compile Include="Models\Response\PullRequestReviewComment.cs" />
|
||||||
<Compile Include="Models\Response\TeamItem.cs" />
|
<Compile Include="Models\Response\TeamItem.cs" />
|
||||||
<Compile Include="Models\Response\Team.cs" />
|
<Compile Include="Models\Response\Team.cs" />
|
||||||
<Compile Include="Models\Response\EventInfo.cs" />
|
<Compile Include="Models\Response\EventInfo.cs" />
|
||||||
|
|||||||
Reference in New Issue
Block a user