mirror of
https://github.com/zoriya/octokit.net.git
synced 2025-12-06 07:16:09 +00:00
Added Id And Locked properties to Issue, fixed XML comment of Update Issue (was a copy of Create Issue)
This commit is contained in:
@@ -22,6 +22,22 @@ public class IssuesClientTests : IDisposable
|
||||
_context = github.CreateRepositoryContext(new NewRepository(repoName)).Result;
|
||||
}
|
||||
|
||||
[IntegrationTest]
|
||||
public async Task CanDeserializeIssue()
|
||||
{
|
||||
const string title = "a test issue";
|
||||
const string description = "A new unassigned issue";
|
||||
var newIssue = new NewIssue(title) { Body = description };
|
||||
var issue = await _issuesClient.Create(_context.RepositoryOwner, _context.RepositoryName, newIssue);
|
||||
var retrieved = await _issuesClient.Get(_context.RepositoryOwner, _context.RepositoryName, issue.Number);
|
||||
|
||||
Assert.NotNull(retrieved);
|
||||
Assert.NotEqual(0, issue.Id);
|
||||
Assert.Equal(false, issue.Locked);
|
||||
Assert.Equal(title, retrieved.Title);
|
||||
Assert.Equal(description, retrieved.Body);
|
||||
}
|
||||
|
||||
[IntegrationTest]
|
||||
public async Task CanCreateRetrieveAndCloseIssue()
|
||||
{
|
||||
|
||||
@@ -208,10 +208,9 @@ namespace Octokit
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates an issue for the specified repository. Any user with pull access to a repository can create an
|
||||
/// issue.
|
||||
/// Updates an issue for the specified repository. Issue owners and users with push access can edit an issue.
|
||||
/// </summary>
|
||||
/// <remarks>http://developer.github.com/v3/issues/#create-an-issue</remarks>
|
||||
/// <remarks>https://developer.github.com/v3/issues/#edit-an-issue</remarks>
|
||||
/// <param name="owner">The owner of the repository</param>
|
||||
/// <param name="name">The name of the repository</param>
|
||||
/// <param name="number">The issue number</param>
|
||||
|
||||
@@ -10,8 +10,9 @@ namespace Octokit
|
||||
{
|
||||
public Issue() { }
|
||||
|
||||
public Issue(Uri url, Uri htmlUrl, Uri commentsUrl, Uri eventsUrl, int number, ItemState state, string title, string body, User user, IReadOnlyList<Label> labels, User assignee, Milestone milestone, int comments, PullRequest pullRequest, DateTimeOffset? closedAt, DateTimeOffset createdAt, DateTimeOffset? updatedAt)
|
||||
public Issue(Uri url, Uri htmlUrl, Uri commentsUrl, Uri eventsUrl, int number, ItemState state, string title, string body, User user, IReadOnlyList<Label> labels, User assignee, Milestone milestone, int comments, PullRequest pullRequest, DateTimeOffset? closedAt, DateTimeOffset createdAt, DateTimeOffset? updatedAt, int id, bool locked)
|
||||
{
|
||||
Id = id;
|
||||
Url = url;
|
||||
HtmlUrl = htmlUrl;
|
||||
CommentsUrl = commentsUrl;
|
||||
@@ -29,8 +30,14 @@ namespace Octokit
|
||||
ClosedAt = closedAt;
|
||||
CreatedAt = createdAt;
|
||||
UpdatedAt = updatedAt;
|
||||
Locked = locked;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The Id for this issue
|
||||
/// </summary>
|
||||
public int Id { get; protected set; }
|
||||
|
||||
/// <summary>
|
||||
/// The URL for this issue.
|
||||
/// </summary>
|
||||
@@ -113,6 +120,11 @@ namespace Octokit
|
||||
/// </summary>
|
||||
public DateTimeOffset? UpdatedAt { get; protected set; }
|
||||
|
||||
/// <summary>
|
||||
/// If the issue is locked or not
|
||||
/// </summary>
|
||||
public bool Locked { get; protected set; }
|
||||
|
||||
internal string DebuggerDisplay
|
||||
{
|
||||
get
|
||||
|
||||
Reference in New Issue
Block a user