当前位置: 首页>>代码示例>>C#>>正文


C# SearchClient.SearchUsers方法代码示例

本文整理汇总了C#中SearchClient.SearchUsers方法的典型用法代码示例。如果您正苦于以下问题:C# SearchClient.SearchUsers方法的具体用法?C# SearchClient.SearchUsers怎么用?C# SearchClient.SearchUsers使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SearchClient的用法示例。


在下文中一共展示了SearchClient.SearchUsers方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: RequestsTheCorrectUrl

 public void RequestsTheCorrectUrl()
 {
     var connection = Substitute.For<IApiConnection>();
     var client = new SearchClient(connection);
     client.SearchUsers(new SearchUsersRequest("something"));
     connection.Received().Get<SearchUsersResult>(Arg.Is<Uri>(u => u.ToString() == "search/users"), Arg.Any<Dictionary<string, string>>());
 }
开发者ID:nsavga,项目名称:octokit.net,代码行数:7,代码来源:SearchClientTests.cs

示例2: TestingTheTermParameter

 public void TestingTheTermParameter()
 {
     var connection = Substitute.For<IApiConnection>();
     var client = new SearchClient(connection);
     var request = new SearchUsersRequest("github");
     client.SearchUsers(request);
     connection.Received().Get<SearchUsersResult>(
         Arg.Is<Uri>(u => u.ToString() == "search/users"),
         Arg.Is<Dictionary<string, string>>(d => d["q"] == "github"));
 }
开发者ID:nsavga,项目名称:octokit.net,代码行数:10,代码来源:SearchClientTests.cs

示例3: TestingTheAccountTypeQualifier_Org

 public void TestingTheAccountTypeQualifier_Org()
 {
     var connection = Substitute.For<IApiConnection>();
     var client = new SearchClient(connection);
     var request = new SearchUsersRequest("github");
     request.AccountType = AccountType.Org;
     client.SearchUsers(request);
     connection.Received().Get<SearchUsersResult>(
         Arg.Is<Uri>(u => u.ToString() == "search/users"),
         Arg.Is<Dictionary<string, string>>(d => d["q"] == "github+type:Org"));
 }
开发者ID:nsavga,项目名称:octokit.net,代码行数:11,代码来源:SearchClientTests.cs

示例4: TestingTheInQualifier_Email

 public void TestingTheInQualifier_Email()
 {
     var connection = Substitute.For<IApiConnection>();
     var client = new SearchClient(connection);
     var request = new SearchUsersRequest("github");
     request.In = new[] { UserInQualifier.Email };
     client.SearchUsers(request);
     connection.Received().Get<SearchUsersResult>(
         Arg.Is<Uri>(u => u.ToString() == "search/users"),
         Arg.Is<Dictionary<string, string>>(d => d["q"] == "github+in:Email"));
 }
开发者ID:nsavga,项目名称:octokit.net,代码行数:11,代码来源:SearchClientTests.cs

示例5: TestingTheInQualifier

 public void TestingTheInQualifier()
 {
     var connection = Substitute.For<IApiConnection>();
     var client = new SearchClient(connection);
     //get users where the fullname contains 'github'
     var request = new SearchUsersRequest("github");
     request.In = new[] { UserInQualifier.Fullname };
     client.SearchUsers(request);
     connection.Received().Get<SearchUsersResult>(
         Arg.Is<Uri>(u => u.ToString() == "search/users"),
         Arg.Is<Dictionary<string, string>>(d => d["q"] == "github+in:Fullname"));
 }
开发者ID:nsavga,项目名称:octokit.net,代码行数:12,代码来源:SearchClientTests.cs

示例6: EnsuresNonNullArguments

 public void EnsuresNonNullArguments()
 {
     var client = new SearchClient(Substitute.For<IApiConnection>());
     Assert.Throws<ArgumentNullException>(() => client.SearchUsers(null));
 }
开发者ID:nsavga,项目名称:octokit.net,代码行数:5,代码来源:SearchClientTests.cs

示例7: TestingTheFollowersQualifier_Range

 public void TestingTheFollowersQualifier_Range()
 {
     var connection = Substitute.For<IApiConnection>();
     var client = new SearchClient(connection);
     var request = new SearchUsersRequest("github");
     request.Followers = new Range(1, 1000);
     client.SearchUsers(request);
     connection.Received().Get<SearchUsersResult>(
         Arg.Is<Uri>(u => u.ToString() == "search/users"),
         Arg.Is<Dictionary<string, string>>(d => d["q"] == "github+followers:1..1000"));
 }
开发者ID:nsavga,项目名称:octokit.net,代码行数:11,代码来源:SearchClientTests.cs

示例8: TestingTheCreatedQualifier_LessThan

 public void TestingTheCreatedQualifier_LessThan()
 {
     var connection = Substitute.For<IApiConnection>();
     var client = new SearchClient(connection);
     var request = new SearchUsersRequest("github");
     request.Created = DateRange.LessThan(new DateTime(2014, 1, 1));
     client.SearchUsers(request);
     connection.Received().Get<SearchUsersResult>(
         Arg.Is<Uri>(u => u.ToString() == "search/users"),
         Arg.Is<Dictionary<string, string>>(d => d["q"] == "github+created:<2014-01-01"));
 }
开发者ID:nsavga,项目名称:octokit.net,代码行数:11,代码来源:SearchClientTests.cs

示例9: TestingTheLanguageQualifier

 public void TestingTheLanguageQualifier()
 {
     var connection = Substitute.For<IApiConnection>();
     var client = new SearchClient(connection);
     //get users who have mostly repos where language is Ruby
     var request = new SearchUsersRequest("github");
     request.Language = Language.Ruby;
     client.SearchUsers(request);
     connection.Received().Get<SearchUsersResult>(
         Arg.Is<Uri>(u => u.ToString() == "search/users"),
         Arg.Is<Dictionary<string, string>>(d => d["q"] == "github+language:Ruby"));
 }
开发者ID:nsavga,项目名称:octokit.net,代码行数:12,代码来源:SearchClientTests.cs

示例10: TestingTheLocationQualifier

 public void TestingTheLocationQualifier()
 {
     var connection = Substitute.For<IApiConnection>();
     var client = new SearchClient(connection);
     var request = new SearchUsersRequest("github");
     request.Location = "San Francisco";
     client.SearchUsers(request);
     connection.Received().Get<SearchUsersResult>(
         Arg.Is<Uri>(u => u.ToString() == "search/users"),
         Arg.Is<Dictionary<string, string>>(d => d["q"] == "github+location:San Francisco"));
 }
开发者ID:nsavga,项目名称:octokit.net,代码行数:11,代码来源:SearchClientTests.cs

示例11: TestingTheReposQualifier_LessThan

 public void TestingTheReposQualifier_LessThan()
 {
     var connection = Substitute.For<IApiConnection>();
     var client = new SearchClient(connection);
     var request = new SearchUsersRequest("github");
     request.Repositories = Range.LessThan(5);
     client.SearchUsers(request);
     connection.Received().Get<SearchUsersResult>(
         Arg.Is<Uri>(u => u.ToString() == "search/users"),
         Arg.Is<Dictionary<string, string>>(d => d["q"] == "github+repos:<5"));
 }
开发者ID:nsavga,项目名称:octokit.net,代码行数:11,代码来源:SearchClientTests.cs

示例12: EnsuresNonNullArguments

 public async Task EnsuresNonNullArguments()
 {
     var client = new SearchClient(Substitute.For<IApiConnection>());
     await Assert.ThrowsAsync<ArgumentNullException>(() => client.SearchUsers(null));
 }
开发者ID:naveensrinivasan,项目名称:octokit.net,代码行数:5,代码来源:SearchClientTests.cs

示例13: TestingTheFollowersQualifier_LessThanOrEqualTo

 public void TestingTheFollowersQualifier_LessThanOrEqualTo()
 {
     var connection = Substitute.For<IApiConnection>();
     var client = new SearchClient(connection);
     var request = new SearchUsersRequest("github");
     request.Followers = Range.LessThanOrEquals(1);
     client.SearchUsers(request);
     connection.Received().GetAll<User>(
         Arg.Is<Uri>(u => u.ToString() == "search/users"),
         Arg.Is<Dictionary<string, string>>(d => d["q"] == "github+followers:<=1"));
 }
开发者ID:pgarbe,项目名称:octokit.net,代码行数:11,代码来源:SearchClientTests.cs


注:本文中的SearchClient.SearchUsers方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。