added support for searching by mentions

This commit is contained in:
Brendan Forster
2014-03-08 12:14:20 +11:00
parent fdbe330cee
commit b8cc3d65a9
2 changed files with 30 additions and 0 deletions

View File

@@ -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()
{

View File

@@ -26,5 +26,10 @@ namespace Octokit
/// Specify "none" for issues with no assigned user
/// </remarks>
public string Creator { get; set; }
/// <summary>
/// A user thats mentioned in the issue
/// </summary>
public string Mentioned { get; set; }
}
}