mirror of
https://github.com/zoriya/octokit.net.git
synced 2025-12-20 14:15:12 +00:00
Replaced public properties by readonly fields with a public getter and cleaned code
This commit is contained in:
@@ -93,9 +93,6 @@ namespace Octokit.Reactive
|
||||
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();
|
||||
}
|
||||
@@ -114,7 +111,6 @@ namespace Octokit.Reactive
|
||||
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();
|
||||
}
|
||||
@@ -133,7 +129,6 @@ namespace Octokit.Reactive
|
||||
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();
|
||||
}
|
||||
|
||||
@@ -98,13 +98,7 @@ public class PullRequestReviewCommentsClientTests : IDisposable
|
||||
[IntegrationTest(Skip = "Requires Blob, Tree, Fork and Pull Request Api implementation")]
|
||||
public async Task CanCreateAndRetrieveReviewComment()
|
||||
{
|
||||
var pullRequestReviewComment = new PullRequestReviewCommentCreate
|
||||
{
|
||||
Body = "A review comment message",
|
||||
CommitId = _pullRequestCommitId,
|
||||
Path = _path,
|
||||
Position = 1,
|
||||
};
|
||||
var pullRequestReviewComment = new PullRequestReviewCommentCreate("A review comment message", _pullRequestCommitId, _path, 1);
|
||||
|
||||
var createdComment = await _client.Create(_ownerName, _repoName, _pullRequestNumber, pullRequestReviewComment);
|
||||
|
||||
|
||||
@@ -8,6 +8,79 @@ using Xunit;
|
||||
|
||||
public class PullRequestReviewCommentsClientTests
|
||||
{
|
||||
public class TheModelConstructors
|
||||
{
|
||||
[Fact]
|
||||
public void PullRequestReviewCommentCreateEnsuresArgumentsValue()
|
||||
{
|
||||
string body = "body";
|
||||
string commitId = "sha";
|
||||
string path = "path";
|
||||
int position = 1;
|
||||
|
||||
var comment = new PullRequestReviewCommentCreate(body, commitId, path, position);
|
||||
|
||||
Assert.Equal(body, comment.Body);
|
||||
Assert.Equal(commitId, comment.CommitId);
|
||||
Assert.Equal(path, comment.Path);
|
||||
Assert.Equal(position, comment.Position);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void PullRequestReviewCommentCreateEnsuresArgumentsNotNull()
|
||||
{
|
||||
string body = "body";
|
||||
string commitId = "sha";
|
||||
string path = "path";
|
||||
int position = 1;
|
||||
|
||||
Assert.Throws<ArgumentNullException>(() => new PullRequestReviewCommentCreate(null, commitId, path, position));
|
||||
Assert.Throws<ArgumentException>(() => new PullRequestReviewCommentCreate("", commitId, path, position));
|
||||
Assert.Throws<ArgumentNullException>(() => new PullRequestReviewCommentCreate(body, null, path, position));
|
||||
Assert.Throws<ArgumentException>(() => new PullRequestReviewCommentCreate(body, "", path, position));
|
||||
Assert.Throws<ArgumentNullException>(() => new PullRequestReviewCommentCreate(body, commitId, null, position));
|
||||
Assert.Throws<ArgumentException>(() => new PullRequestReviewCommentCreate(body, commitId, "", position));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void PullRequestReviewCommentEditEnsuresArgumentsValue()
|
||||
{
|
||||
string body = "body";
|
||||
|
||||
var comment = new PullRequestReviewCommentEdit(body);
|
||||
|
||||
Assert.Equal(body, comment.Body);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void PullRequestReviewCommentEditEnsuresArgumentsNotNull()
|
||||
{
|
||||
Assert.Throws<ArgumentNullException>(() => new PullRequestReviewCommentEdit(null));
|
||||
Assert.Throws<ArgumentException>(() => new PullRequestReviewCommentEdit(""));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void PullRequestReviewCommentReplyCreateEnsuresArgumentsValue()
|
||||
{
|
||||
string body = "body";
|
||||
int inReplyTo = 1;
|
||||
|
||||
var comment = new PullRequestReviewCommentReplyCreate(body, inReplyTo);
|
||||
|
||||
Assert.Equal(body, comment.Body);
|
||||
Assert.Equal(inReplyTo, comment.InReplyTo);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void PullRequestReviewCommentReplyCreateEnsuresArgumentsNotNull()
|
||||
{
|
||||
int inReplyTo = 1;
|
||||
|
||||
Assert.Throws<ArgumentNullException>(() => new PullRequestReviewCommentReplyCreate(null, inReplyTo));
|
||||
Assert.Throws<ArgumentException>(() => new PullRequestReviewCommentReplyCreate("", inReplyTo));
|
||||
}
|
||||
}
|
||||
|
||||
public class TheGetForPullRequestMethod
|
||||
{
|
||||
[Fact]
|
||||
@@ -131,13 +204,7 @@ public class PullRequestReviewCommentsClientTests
|
||||
var connection = Substitute.For<IApiConnection>();
|
||||
var client = new PullRequestReviewCommentsClient(connection);
|
||||
|
||||
var comment = new PullRequestReviewCommentCreate
|
||||
{
|
||||
Body = "Comment content",
|
||||
CommitId = "qe3dsdsf6",
|
||||
Path = "file.css",
|
||||
Position = 7,
|
||||
};
|
||||
var comment = new PullRequestReviewCommentCreate("Comment content", "qe3dsdsf6", "file.css", 7);
|
||||
|
||||
client.Create("fakeOwner", "fakeRepoName", 13, comment);
|
||||
|
||||
@@ -156,37 +223,13 @@ public class PullRequestReviewCommentsClientTests
|
||||
string path = "file.css";
|
||||
int position = 7;
|
||||
|
||||
var comment = new PullRequestReviewCommentCreate
|
||||
{
|
||||
Body = body,
|
||||
CommitId = commitId,
|
||||
Path = path,
|
||||
Position = position,
|
||||
};
|
||||
var comment = new PullRequestReviewCommentCreate(body, commitId, path, 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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -198,11 +241,7 @@ public class PullRequestReviewCommentsClientTests
|
||||
var connection = Substitute.For<IApiConnection>();
|
||||
var client = new PullRequestReviewCommentsClient(connection);
|
||||
|
||||
var comment = new PullRequestReviewCommentReplyCreate
|
||||
{
|
||||
Body = "Comment content",
|
||||
InReplyTo = 5
|
||||
};
|
||||
var comment = new PullRequestReviewCommentReplyCreate("Comment content", 5);
|
||||
|
||||
client.CreateReply("fakeOwner", "fakeRepoName", 13, comment);
|
||||
|
||||
@@ -219,23 +258,13 @@ public class PullRequestReviewCommentsClientTests
|
||||
string body = "Comment content";
|
||||
int inReplyTo = 7;
|
||||
|
||||
var comment = new PullRequestReviewCommentReplyCreate
|
||||
{
|
||||
Body = body,
|
||||
InReplyTo = inReplyTo,
|
||||
};
|
||||
var comment = new PullRequestReviewCommentReplyCreate(body, 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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -247,10 +276,7 @@ public class PullRequestReviewCommentsClientTests
|
||||
var connection = Substitute.For<IApiConnection>();
|
||||
var client = new PullRequestReviewCommentsClient(connection);
|
||||
|
||||
var comment = new PullRequestReviewCommentEdit
|
||||
{
|
||||
Body = "New comment content",
|
||||
};
|
||||
var comment = new PullRequestReviewCommentEdit("New comment content");
|
||||
|
||||
client.Edit("fakeOwner", "fakeRepoName", 13, comment);
|
||||
|
||||
@@ -265,22 +291,13 @@ public class PullRequestReviewCommentsClientTests
|
||||
|
||||
var body = "New comment content";
|
||||
|
||||
var comment = new PullRequestReviewCommentEdit
|
||||
{
|
||||
Body = body,
|
||||
};
|
||||
var comment = new PullRequestReviewCommentEdit(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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -276,13 +276,7 @@ namespace Octokit.Tests.Reactive
|
||||
var gitHubClient = Substitute.For<IGitHubClient>();
|
||||
var client = new ObservablePullRequestReviewCommentsClient(gitHubClient);
|
||||
|
||||
var comment = new PullRequestReviewCommentCreate
|
||||
{
|
||||
Body = "Comment content",
|
||||
CommitId = "qe3dsdsf6",
|
||||
Path = "file.css",
|
||||
Position = 7,
|
||||
};
|
||||
var comment = new PullRequestReviewCommentCreate("Comment content", "qe3dsdsf6", "file.css", 7);
|
||||
|
||||
client.Create("fakeOwner", "fakeRepoName", 13, comment);
|
||||
|
||||
@@ -300,37 +294,13 @@ namespace Octokit.Tests.Reactive
|
||||
string path = "file.css";
|
||||
int position = 7;
|
||||
|
||||
var comment = new PullRequestReviewCommentCreate
|
||||
{
|
||||
Body = body,
|
||||
CommitId = commitId,
|
||||
Path = path,
|
||||
Position = position,
|
||||
};
|
||||
var comment = new PullRequestReviewCommentCreate(body, commitId, path, 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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -342,11 +312,7 @@ namespace Octokit.Tests.Reactive
|
||||
var gitHubClient = Substitute.For<IGitHubClient>();
|
||||
var client = new ObservablePullRequestReviewCommentsClient(gitHubClient);
|
||||
|
||||
var comment = new PullRequestReviewCommentReplyCreate
|
||||
{
|
||||
Body = "Comment content",
|
||||
InReplyTo = 9,
|
||||
};
|
||||
var comment = new PullRequestReviewCommentReplyCreate("Comment content", 9);
|
||||
|
||||
client.CreateReply("fakeOwner", "fakeRepoName", 13, comment);
|
||||
|
||||
@@ -362,23 +328,13 @@ namespace Octokit.Tests.Reactive
|
||||
string body = "Comment content";
|
||||
int inReplyTo = 7;
|
||||
|
||||
var comment = new PullRequestReviewCommentReplyCreate
|
||||
{
|
||||
Body = body,
|
||||
InReplyTo = inReplyTo,
|
||||
};
|
||||
var comment = new PullRequestReviewCommentReplyCreate(body, inReplyTo);
|
||||
|
||||
await AssertEx.Throws<ArgumentNullException>(async () => await client.CreateReply(null, "name", 1, comment));
|
||||
await AssertEx.Throws<ArgumentException>(async () => await client.CreateReply("", "name", 1, comment));
|
||||
await AssertEx.Throws<ArgumentNullException>(async () => await client.CreateReply("owner", null, 1, comment));
|
||||
await AssertEx.Throws<ArgumentException>(async () => await client.CreateReply("owner", "", 1, comment));
|
||||
await AssertEx.Throws<ArgumentNullException>(async () => await client.CreateReply("owner", "name", 1, null));
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -390,10 +346,7 @@ namespace Octokit.Tests.Reactive
|
||||
var gitHubClient = Substitute.For<IGitHubClient>();
|
||||
var client = new ObservablePullRequestReviewCommentsClient(gitHubClient);
|
||||
|
||||
var comment = new PullRequestReviewCommentEdit
|
||||
{
|
||||
Body = "New comment content",
|
||||
};
|
||||
var comment = new PullRequestReviewCommentEdit("New comment content");
|
||||
|
||||
client.Edit("fakeOwner", "fakeRepoName", 13, comment);
|
||||
|
||||
@@ -408,22 +361,13 @@ namespace Octokit.Tests.Reactive
|
||||
|
||||
var body = "New comment content";
|
||||
|
||||
var comment = new PullRequestReviewCommentEdit
|
||||
{
|
||||
Body = body,
|
||||
};
|
||||
var comment = new PullRequestReviewCommentEdit(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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -86,9 +86,6 @@ namespace Octokit
|
||||
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");
|
||||
|
||||
var response = await ApiConnection.Connection.PostAsync<PullRequestReviewComment>(ApiUrls.PullRequestReviewComments(owner, name, number), comment, null, null).ConfigureAwait(false);
|
||||
|
||||
@@ -114,7 +111,6 @@ namespace Octokit
|
||||
Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
|
||||
Ensure.ArgumentNotNullOrEmptyString(name, "name");
|
||||
Ensure.ArgumentNotNull(comment, "comment");
|
||||
Ensure.ArgumentNotNullOrEmptyString(comment.Body, "body");
|
||||
|
||||
var response = await ApiConnection.Connection.PostAsync<PullRequestReviewComment>(ApiUrls.PullRequestReviewComments(owner, name, number), comment, null, null).ConfigureAwait(false);
|
||||
|
||||
@@ -140,7 +136,6 @@ namespace Octokit
|
||||
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);
|
||||
}
|
||||
|
||||
@@ -4,25 +4,48 @@ namespace Octokit
|
||||
{
|
||||
public class PullRequestReviewCommentCreate : RequestParameters
|
||||
{
|
||||
private readonly string _body;
|
||||
private readonly string _commitId;
|
||||
private readonly string _path;
|
||||
private readonly int _position;
|
||||
|
||||
/// <summary>
|
||||
/// The text of the comment.
|
||||
/// </summary>
|
||||
public string Body { get; set; }
|
||||
public string Body { get { return _body; } }
|
||||
|
||||
/// <summary>
|
||||
/// The SHA of the commit to comment on.
|
||||
/// </summary>
|
||||
[Parameter(Key = "commit_id")]
|
||||
public string CommitId { get; set; }
|
||||
public string CommitId { get { return _commitId; } }
|
||||
|
||||
/// <summary>
|
||||
/// The relative path of the file to comment on.
|
||||
/// </summary>
|
||||
public string Path { get; set; }
|
||||
public string Path { get { return _path; } }
|
||||
|
||||
/// <summary>
|
||||
/// The line index in the diff to comment on.
|
||||
/// </summary>
|
||||
public int Position { get; set; }
|
||||
public int Position { get { return _position; } }
|
||||
|
||||
/// <summary>
|
||||
/// Creates a comment
|
||||
/// </summary>
|
||||
/// <param name="body">The text of the comment</param>
|
||||
/// <param name="commitId">The SHA of the commit to comment on</param>
|
||||
/// <param name="path">The relative path of the file to comment on</param>
|
||||
/// <param name="position">The line index in the diff to comment on</param>
|
||||
public PullRequestReviewCommentCreate(string body, string commitId, string path, int position)
|
||||
{
|
||||
Ensure.ArgumentNotNullOrEmptyString(body, "body");
|
||||
Ensure.ArgumentNotNullOrEmptyString(commitId, "commitId");
|
||||
Ensure.ArgumentNotNullOrEmptyString(path, "path");
|
||||
|
||||
_body = body;
|
||||
_commitId = commitId;
|
||||
_path = path;
|
||||
_position = position;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,9 +3,22 @@ namespace Octokit
|
||||
{
|
||||
public class PullRequestReviewCommentEdit : RequestParameters
|
||||
{
|
||||
private readonly string _body;
|
||||
|
||||
/// <summary>
|
||||
/// The text of the comment.
|
||||
/// </summary>
|
||||
public string Body { get; set; }
|
||||
public string Body { get { return _body; }}
|
||||
|
||||
/// <summary>
|
||||
/// Creates an edit to a comment
|
||||
/// </summary>
|
||||
/// <param name="body">The text of the comment</param>
|
||||
public PullRequestReviewCommentEdit(string body)
|
||||
{
|
||||
Ensure.ArgumentNotNullOrEmptyString(body, "body");
|
||||
|
||||
_body = body;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,15 +4,30 @@ namespace Octokit
|
||||
{
|
||||
public class PullRequestReviewCommentReplyCreate : RequestParameters
|
||||
{
|
||||
private readonly string _body;
|
||||
private readonly int _inReplyTo;
|
||||
|
||||
/// <summary>
|
||||
/// The text of the comment.
|
||||
/// </summary>
|
||||
public string Body { get; set; }
|
||||
public string Body { get { return _body; } }
|
||||
|
||||
/// <summary>
|
||||
/// The comment Id to reply to.
|
||||
/// </summary>
|
||||
[Parameter(Key = "in_reply_to")]
|
||||
public int InReplyTo { get; set; }
|
||||
public int InReplyTo { get { return _inReplyTo; } }
|
||||
|
||||
/// <summary>
|
||||
/// Creates a comment that is replying to another comment.
|
||||
/// </summary>
|
||||
/// <param name="body">The text of the comment</param>
|
||||
/// <param name="inReplyTo">The comment Id to reply to</param>
|
||||
public PullRequestReviewCommentReplyCreate(string body, int inReplyTo)
|
||||
{
|
||||
Ensure.ArgumentNotNullOrEmptyString(body, "body");
|
||||
|
||||
_body = body;
|
||||
_inReplyTo = inReplyTo;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,7 +7,6 @@ namespace Octokit
|
||||
public PullRequestReviewCommentRequest()
|
||||
{
|
||||
// Default arguments
|
||||
|
||||
Sort = PullRequestReviewCommentSort.Created;
|
||||
Direction = SortDirection.Ascending;
|
||||
Since = null;
|
||||
|
||||
Reference in New Issue
Block a user