Skip to content

Commit

Permalink
Add Id for PullRequest.cs (#1537)
Browse files Browse the repository at this point in the history
* add Id for PullRequest.cs

added the Id property for PullRequest model

* use long for pull request id

* update comments for PullRequest.Id and Issue.Id

make it more intuitive... a question, issue.Id and comment.Id are int
type. do we have any concern on it?

* plus the one for pullrequest

forgot to check this change.

* update the integration test for Id Property

long will never be null
  • Loading branch information
YunLi1988 authored and ryangribble committed Jan 14, 2017
1 parent eeb98c7 commit fcee797
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ public async Task CanGetForRepository()

Assert.Equal(1, pullRequests.Count);
Assert.Equal(result.Title, pullRequests[0].Title);
Assert.True(pullRequests[0].Id > 0);
}

[IntegrationTest]
Expand Down
2 changes: 1 addition & 1 deletion Octokit/Models/Response/Issue.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public Issue(Uri url, Uri htmlUrl, Uri commentsUrl, Uri eventsUrl, int number, I
}

/// <summary>
/// The Id for this issue
/// The internal Id for this issue (not the issue number)
/// </summary>
public int Id { get; protected set; }

Expand Down
8 changes: 7 additions & 1 deletion Octokit/Models/Response/PullRequest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@ public PullRequest(int number)
Number = number;
}

public PullRequest(Uri url, Uri htmlUrl, Uri diffUrl, Uri patchUrl, Uri issueUrl, Uri statusesUrl, int number, ItemState state, string title, string body, DateTimeOffset createdAt, DateTimeOffset updatedAt, DateTimeOffset? closedAt, DateTimeOffset? mergedAt, GitReference head, GitReference @base, User user, User assignee, IReadOnlyList<User> assignees, bool? mergeable, User mergedBy, int comments, int commits, int additions, int deletions, int changedFiles, Milestone milestone, bool locked)
public PullRequest(long id, Uri url, Uri htmlUrl, Uri diffUrl, Uri patchUrl, Uri issueUrl, Uri statusesUrl, int number, ItemState state, string title, string body, DateTimeOffset createdAt, DateTimeOffset updatedAt, DateTimeOffset? closedAt, DateTimeOffset? mergedAt, GitReference head, GitReference @base, User user, User assignee, IReadOnlyList<User> assignees, bool? mergeable, User mergedBy, int comments, int commits, int additions, int deletions, int changedFiles, Milestone milestone, bool locked)
{
Id = id;
Url = url;
HtmlUrl = htmlUrl;
DiffUrl = diffUrl;
Expand Down Expand Up @@ -47,6 +48,11 @@ public PullRequest(Uri url, Uri htmlUrl, Uri diffUrl, Uri patchUrl, Uri issueUrl
Locked = locked;
}

/// <summary>
/// The internal Id for this pull request (not the pull request number)
/// </summary>
public long Id { get; protected set; }

/// <summary>
/// The URL for this pull request.
/// </summary>
Expand Down

0 comments on commit fcee797

Please sign in to comment.