diff --git a/Octokit.Tests.Integration/Clients/ProjectCardsClientTests.cs b/Octokit.Tests.Integration/Clients/ProjectCardsClientTests.cs index 3c127e0b9d..3f183e6b1d 100644 --- a/Octokit.Tests.Integration/Clients/ProjectCardsClientTests.cs +++ b/Octokit.Tests.Integration/Clients/ProjectCardsClientTests.cs @@ -202,9 +202,8 @@ public class TheCreateMethod : IDisposable public TheCreateMethod() { _github = Helper.GetAuthenticatedClient(); - var repoName = Helper.MakeNameWithTimestamp("public-repo"); - _context = _github.CreateRepositoryContext(new NewRepository(repoName)).Result; + _context = _github.CreateRepositoryContext("public-repo").Result; } [IntegrationTest] @@ -228,6 +227,23 @@ public async Task CreatesIssueCard() Assert.NotNull(card); } + [IntegrationTest] + public async Task CreatesPullRequestCard() + { + await _github.CreateTheWorld(_context.Repository); + + var project = await CreateRepositoryProjectHelper(_github, _context.RepositoryId); + + var pullRequest = await _github.CreatePullRequest(_context.Repository); + + var column = await CreateColumnHelper(_github, project.Id); + + var newCard = new NewProjectCard(pullRequest.Id, ProjectCardContentType.PullRequest); + var result = await _github.Repository.Project.Card.Create(column.Id, newCard); + + Assert.NotNull(result); + } + public void Dispose() { if (_context != null) diff --git a/Octokit/Models/Request/NewProjectCard.cs b/Octokit/Models/Request/NewProjectCard.cs index 35c8cb2886..8457838115 100644 --- a/Octokit/Models/Request/NewProjectCard.cs +++ b/Octokit/Models/Request/NewProjectCard.cs @@ -12,7 +12,7 @@ public NewProjectCard(string note) Note = note; } - public NewProjectCard(int contentId, ProjectCardContentType contentType) + public NewProjectCard(long contentId, ProjectCardContentType contentType) { ContentId = contentId; ContentType = contentType; @@ -27,7 +27,7 @@ public NewProjectCard(int contentId, ProjectCardContentType contentType) /// The id of the Issue or Pull Request to associate with this card. /// [Parameter(Key = "content_id")] - public int? ContentId { get; protected set; } + public long? ContentId { get; protected set; } /// /// The type of content to associate with this card. @@ -46,7 +46,9 @@ internal string DebuggerDisplay public enum ProjectCardContentType { - [Parameter(Value = "Issue")] - Issue + [Parameter(Value = nameof(Issue))] + Issue, + [Parameter(Value = nameof(PullRequest))] + PullRequest } }