mirror of
https://github.com/zoriya/octokit.net.git
synced 2026-06-05 03:30:34 +00:00
Added overloads with a single string
This commit is contained in:
@@ -76,7 +76,7 @@ public class SearchClientTests
|
||||
public async Task SearchForAllIssuesWithouTaskUsingTerm()
|
||||
{
|
||||
var request = new SearchIssuesRequest();
|
||||
request.Repos.Add("caliburn-micro", "caliburn.micro");
|
||||
request.Repos.Add("caliburn-micro/caliburn.micro");
|
||||
|
||||
var issues = await _gitHubClient.Search.SearchIssues(request);
|
||||
|
||||
|
||||
@@ -1184,7 +1184,7 @@ namespace Octokit.Tests.Clients
|
||||
var connection = Substitute.For<IApiConnection>();
|
||||
var client = new SearchClient(connection);
|
||||
var request = new SearchIssuesRequest("something");
|
||||
request.Repos.Add("octokit", "octokit.net");
|
||||
request.Repos.Add("octokit/octokit.net");
|
||||
request.User = "alfhenrik";
|
||||
request.Labels = new[] { "bug" };
|
||||
|
||||
@@ -1513,7 +1513,7 @@ namespace Octokit.Tests.Clients
|
||||
|
||||
var request = new SearchCodeRequest("windows");
|
||||
request.Repos = new RepositoryCollection {
|
||||
{ "haha-business", "some&name" }
|
||||
"haha-business"
|
||||
};
|
||||
|
||||
request.Order = SortDirection.Descending;
|
||||
|
||||
@@ -359,6 +359,13 @@ namespace Octokit
|
||||
_repositories.Add(GetRepositoryName(owner, name));
|
||||
}
|
||||
|
||||
public void Add(string nameWithOwner)
|
||||
{
|
||||
Ensure.ArgumentNotNullOrEmptyString(nameWithOwner, "nameWithOwner");
|
||||
|
||||
_repositories.Add(nameWithOwner);
|
||||
}
|
||||
|
||||
public void Clear()
|
||||
{
|
||||
_repositories.Clear();
|
||||
@@ -372,6 +379,13 @@ namespace Octokit
|
||||
return _repositories.Contains(GetRepositoryName(owner, name));
|
||||
}
|
||||
|
||||
public bool Contains(string nameWithOwner)
|
||||
{
|
||||
Ensure.ArgumentNotNullOrEmptyString(nameWithOwner, "nameWithOwner");
|
||||
|
||||
return _repositories.Contains(nameWithOwner);
|
||||
}
|
||||
|
||||
public bool Remove(string owner, string name)
|
||||
{
|
||||
Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
|
||||
@@ -380,6 +394,13 @@ namespace Octokit
|
||||
return _repositories.Remove(GetRepositoryName(owner, name));
|
||||
}
|
||||
|
||||
public bool Remove(string nameWithOwner)
|
||||
{
|
||||
Ensure.ArgumentNotNullOrEmptyString(nameWithOwner, "nameWithOwner");
|
||||
|
||||
return _repositories.Remove(nameWithOwner);
|
||||
}
|
||||
|
||||
private static string GetRepositoryName(string owner, string name)
|
||||
{
|
||||
return string.Format(CultureInfo.InvariantCulture, "{0}/{1}", owner, name);
|
||||
|
||||
Reference in New Issue
Block a user