diff --git a/Octokit.Tests.Integration/Clients/IssuesClientTests.cs b/Octokit.Tests.Integration/Clients/IssuesClientTests.cs index ad02ff1b..41e2016d 100644 --- a/Octokit.Tests.Integration/Clients/IssuesClientTests.cs +++ b/Octokit.Tests.Integration/Clients/IssuesClientTests.cs @@ -212,6 +212,31 @@ public class IssuesClientTests : IDisposable Assert.Equal(0, issuesCreatedByExternalUser.Count); } + [IntegrationTest] + public async Task CanFilterByMentioned() + { + var owner = _repository.Owner.Login; + var newIssue1 = new NewIssue("An issue") { Body = "words words words hello there @shiftkey" }; + var newIssue2 = new NewIssue("Another issue") { Body = "some other words" }; + await _issuesClient.Create(owner, _repository.Name, newIssue1); + await _issuesClient.Create(owner, _repository.Name, newIssue2); + + var allIssues = await _issuesClient.GetForRepository(owner, _repository.Name, + new RepositoryIssueRequest()); + + Assert.Equal(2, allIssues.Count); + + var mentionsWithShiftkey = await _issuesClient.GetForRepository(owner, _repository.Name, + new RepositoryIssueRequest { Mentioned = "shiftkey" }); + + Assert.Equal(1, mentionsWithShiftkey.Count); + + var mentionsWithHaacked = await _issuesClient.GetForRepository(owner, _repository.Name, + new RepositoryIssueRequest { Mentioned = "haacked" }); + + Assert.Equal(0, mentionsWithHaacked.Count); + } + [IntegrationTest] public async Task FilteringByInvalidAccountThrowsError() { diff --git a/Octokit/Models/Request/RepositoryIssueRequest.cs b/Octokit/Models/Request/RepositoryIssueRequest.cs index e1008e02..f125afd4 100644 --- a/Octokit/Models/Request/RepositoryIssueRequest.cs +++ b/Octokit/Models/Request/RepositoryIssueRequest.cs @@ -26,5 +26,10 @@ namespace Octokit /// Specify "none" for issues with no assigned user /// public string Creator { get; set; } + + /// + /// A user that’s mentioned in the issue + /// + public string Mentioned { get; set; } } }