mirror of
https://github.com/zoriya/octokit.net.git
synced 2025-12-06 07:16:09 +00:00
added support for searching by mentions
This commit is contained in:
@@ -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()
|
||||
{
|
||||
|
||||
@@ -26,5 +26,10 @@ namespace Octokit
|
||||
/// Specify "none" for issues with no assigned user
|
||||
/// </remarks>
|
||||
public string Creator { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// A user that’s mentioned in the issue
|
||||
/// </summary>
|
||||
public string Mentioned { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user