mirror of
https://github.com/zoriya/octokit.net.git
synced 2026-06-02 19:00:47 +00:00
#418 Add repo parameters for code search
This commit is contained in:
@@ -1441,6 +1441,21 @@ namespace Octokit.Tests.Clients
|
||||
Arg.Is<Dictionary<string, string>>(d => d["q"] == "something+repo:octokit.net"));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void TestingTheRepoQualifier_InConstructor()
|
||||
{
|
||||
var connection = Substitute.For<IApiConnection>();
|
||||
var client = new SearchClient(connection);
|
||||
var request = new SearchCodeRequest("something", "octokit.net");
|
||||
|
||||
client.SearchCode(request);
|
||||
|
||||
connection.Received().Get<SearchCodeResult>(
|
||||
Arg.Is<Uri>(u => u.ToString() == "search/code"),
|
||||
Arg.Is<Dictionary<string, string>>(d =>
|
||||
d["q"] == "something+repo:octokit.net"));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void TestingTheRepoAndPathAndExtensionQualifiers()
|
||||
{
|
||||
|
||||
@@ -18,6 +18,12 @@ namespace Octokit
|
||||
{
|
||||
public SearchCodeRequest(string term) : base(term) { }
|
||||
|
||||
public SearchCodeRequest(string term, string repo)
|
||||
: this(term)
|
||||
{
|
||||
this.Repo = repo;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Optional Sort field. Can only be indexed, which indicates how recently
|
||||
/// a file has been indexed by the GitHub search infrastructure.
|
||||
|
||||
Reference in New Issue
Block a user