From e7f17bd68d4fcaed4a9f033df22ee7e406452571 Mon Sep 17 00:00:00 2001 From: Gabriel Weyer Date: Wed, 23 Dec 2015 16:10:35 +1100 Subject: [PATCH 1/3] Added Id And Locked properties to Issue, fixed XML comment of Update Issue (was a copy of Create Issue) --- .../Clients/IssuesClientTests.cs | 16 ++++++++++++++++ Octokit/Clients/IssuesClient.cs | 5 ++--- Octokit/Models/Response/Issue.cs | 14 +++++++++++++- 3 files changed, 31 insertions(+), 4 deletions(-) diff --git a/Octokit.Tests.Integration/Clients/IssuesClientTests.cs b/Octokit.Tests.Integration/Clients/IssuesClientTests.cs index f930d32285..73284093a5 100644 --- a/Octokit.Tests.Integration/Clients/IssuesClientTests.cs +++ b/Octokit.Tests.Integration/Clients/IssuesClientTests.cs @@ -22,6 +22,22 @@ public IssuesClientTests() _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() { diff --git a/Octokit/Clients/IssuesClient.cs b/Octokit/Clients/IssuesClient.cs index 2dbabc8997..8b924245bb 100644 --- a/Octokit/Clients/IssuesClient.cs +++ b/Octokit/Clients/IssuesClient.cs @@ -208,10 +208,9 @@ public Task Create(string owner, string name, NewIssue newIssue) } /// - /// 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. /// - /// http://developer.github.com/v3/issues/#create-an-issue + /// https://developer.github.com/v3/issues/#edit-an-issue /// The owner of the repository /// The name of the repository /// The issue number diff --git a/Octokit/Models/Response/Issue.cs b/Octokit/Models/Response/Issue.cs index c676f11180..e961fe7c32 100644 --- a/Octokit/Models/Response/Issue.cs +++ b/Octokit/Models/Response/Issue.cs @@ -10,8 +10,9 @@ public class Issue { public Issue() { } - public Issue(Uri url, Uri htmlUrl, Uri commentsUrl, Uri eventsUrl, int number, ItemState state, string title, string body, User user, IReadOnlyList