mirror of
https://github.com/zoriya/octokit.net.git
synced 2026-06-05 11:40:42 +00:00
rework the rules
This commit is contained in:
@@ -1159,6 +1159,24 @@ namespace Octokit.Tests.Clients
|
||||
Arg.Is<Dictionary<string, string>>(d => d["q"] == "something+repo:octokit/octokit.net"));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ErrorOccursWhenSpecifyingInvalidFormatForRepos()
|
||||
{
|
||||
var connection = Substitute.For<IApiConnection>();
|
||||
var client = new SearchClient(connection);
|
||||
|
||||
var request = new SearchIssuesRequest("windows");
|
||||
request.Repos = new Collection<string> {
|
||||
"haha-business"
|
||||
};
|
||||
|
||||
request.SortField = IssueSearchSort.Created;
|
||||
request.Order = SortDirection.Descending;
|
||||
|
||||
await Assert.ThrowsAsync<RepositoryFormatException>(
|
||||
async () => await client.SearchIssues(request));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void TestingTheRepoAndUserAndLabelQualifier()
|
||||
{
|
||||
@@ -1450,7 +1468,7 @@ namespace Octokit.Tests.Clients
|
||||
|
||||
connection.Received().Get<SearchCodeResult>(
|
||||
Arg.Is<Uri>(u => u.ToString() == "search/code"),
|
||||
Arg.Is<Dictionary<string, string>>(d => d["q"] == "something+repo:octokit.net"));
|
||||
Arg.Is<Dictionary<string, string>>(d => d["q"] == "something+repo:octokit/octokit.net"));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@@ -1482,7 +1500,7 @@ namespace Octokit.Tests.Clients
|
||||
connection.Received().Get<SearchCodeResult>(
|
||||
Arg.Is<Uri>(u => u.ToString() == "search/code"),
|
||||
Arg.Is<Dictionary<string, string>>(d =>
|
||||
d["q"] == "something+path:tools/FAKE.core+extension:fs+repo:octokit.net"));
|
||||
d["q"] == "something+path:tools/FAKE.core+extension:fs+repo:octokit/octokit.net"));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@@ -1491,19 +1509,16 @@ namespace Octokit.Tests.Clients
|
||||
var connection = Substitute.For<IApiConnection>();
|
||||
var client = new SearchClient(connection);
|
||||
|
||||
var request = new SearchIssuesRequest("windows");
|
||||
var request = new SearchCodeRequest("windows");
|
||||
request.Repos = new Collection<string> {
|
||||
"haha-business"
|
||||
};
|
||||
|
||||
request.SortField = IssueSearchSort.Created;
|
||||
request.Order = SortDirection.Descending;
|
||||
|
||||
await Assert.ThrowsAsync<ArgumentException>(
|
||||
async () => await client.SearchIssues(request));
|
||||
await Assert.ThrowsAsync<RepositoryFormatException>(
|
||||
async () => await client.SearchCode(request));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user