• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# SearchRepositoriesRequest类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中SearchRepositoriesRequest的典型用法代码示例。如果您正苦于以下问题:C# SearchRepositoriesRequest类的具体用法?C# SearchRepositoriesRequest怎么用?C# SearchRepositoriesRequest使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



SearchRepositoriesRequest类属于命名空间,在下文中一共展示了SearchRepositoriesRequest类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: TestingTheStarsQualifier

            public void TestingTheStarsQualifier()
            {
                var connection = Substitute.For<IApiConnection>();
                var client = new SearchClient(connection);
                //get repos whos stargazers are greater than 500
                var request = new SearchRepositoriesRequest("github");
                request.Stars = Range.GreaterThan(500);

                client.SearchRepo(request);

                connection.Received().GetAll<Repository>(Arg.Is<Uri>(u => u.ToString() == "search/repositories"), Arg.Any<Dictionary<string, string>>());
            }
开发者ID:rgmills,项目名称:octokit.net,代码行数:12,代码来源:SearchClientTests.cs


示例2: TestingTheLangaugeQualifier

            public void TestingTheLangaugeQualifier()
            {
                var connection = Substitute.For<IApiConnection>();
                var client = new SearchClient(connection);
                //get repos whos language is Ruby
                var request = new SearchRepositoriesRequest("github");
                request.Language = Language.Ruby;

                client.SearchRepo(request);

                connection.Received().Get<SearchRepositoryResult>(Arg.Is<Uri>(u => u.ToString() == "search/repositories"), Arg.Any<Dictionary<string, string>>());
            }
开发者ID:nsavga,项目名称:octokit.net,代码行数:12,代码来源:SearchClientTests.cs


示例3: TestingTheForkQualifier

            public void TestingTheForkQualifier()
            {
                var connection = Substitute.For<IApiConnection>();
                var client = new SearchClient(connection);
                //search repos that contains rails and forks are included in the search
                var request = new SearchRepositoriesRequest("rails");
                request.Fork = ForkQualifier.IncludeForks;

                client.SearchRepo(request);

                connection.Received().Get<SearchRepositoryResult>(Arg.Is<Uri>(u => u.ToString() == "search/repositories"), Arg.Any<Dictionary<string, string>>());
            }
开发者ID:nsavga,项目名称:octokit.net,代码行数:12,代码来源:SearchClientTests.cs


示例4: TestingTheSizeQualifier

            public void TestingTheSizeQualifier()
            {
                var connection = Substitute.For<IApiConnection>();
                var client = new SearchClient(connection);
                //check sizes for repos that are greater than 50 MB
                var request = new SearchRepositoriesRequest("github");
                request.Size = Range.GreaterThan(50);

                client.SearchRepo(request);

                connection.Received().Get<SearchRepositoryResult>(Arg.Is<Uri>(u => u.ToString() == "search/repositories"), Arg.Any<Dictionary<string, string>>());
            }
开发者ID:nsavga,项目名称:octokit.net,代码行数:12,代码来源:SearchClientTests.cs


示例5: SearchRepo

 /// <summary>
 /// search repos
 /// http://developer.github.com/v3/search/#search-repositories
 /// </summary>
 /// <param name="search"></param>
 /// <returns>List of repositories</returns>
 public IObservable<SearchRepositoryResult> SearchRepo(SearchRepositoriesRequest search)
 {
     Ensure.ArgumentNotNull(search, "search");
     return _client.SearchRepo(search).ToObservable();
 }
开发者ID:cloudRoutine,项目名称:octokit.net,代码行数:11,代码来源:ObservableSearchClient.cs


示例6: TestingTheSearchParameter

            public void TestingTheSearchParameter()
            {
                var connection = Substitute.For<IApiConnection>();
                var client = new SearchClient(connection);
                var request = new SearchRepositoriesRequest();

                client.SearchRepo(request);

                connection.Received().Get<SearchRepositoryResult>(
                    Arg.Is<Uri>(u => u.ToString() == "search/repositories"),
                    Arg.Is<Dictionary<string, string>>(d =>
                        String.IsNullOrEmpty(d["q"])));
            }
开发者ID:naveensrinivasan,项目名称:octokit.net,代码行数:13,代码来源:SearchClientTests.cs


示例7: TestingTheUserQualifier

            public void TestingTheUserQualifier()
            {
                var connection = Substitute.For<IApiConnection>();
                var client = new SearchClient(connection);
                //get repos where the Description contains rails and user/org is 'github'
                var request = new SearchRepositoriesRequest("rails");
                request.User = "github";

                client.SearchRepo(request);

                connection.Received().GetAll<Repository>(Arg.Is<Uri>(u => u.ToString() == "search/repositories"), Arg.Any<Dictionary<string, string>>());
            }
开发者ID:rgmills,项目名称:octokit.net,代码行数:12,代码来源:SearchClientTests.cs


示例8: TestingTheSortParameter

            public void TestingTheSortParameter()
            {
                var connection = Substitute.For<IApiConnection>();
                var client = new SearchClient(connection);
                //get repos where the Description contains rails and user/org is 'github'
                var request = new SearchRepositoriesRequest("rails");
                request.Sort = RepoSearchSort.Forks;

                client.SearchRepo(request);

                connection.Received().Get<SearchRepositoryResult>(Arg.Is<Uri>(u => u.ToString() == "search/repositories"), Arg.Any<Dictionary<string, string>>());
            }
开发者ID:nsavga,项目名称:octokit.net,代码行数:12,代码来源:SearchClientTests.cs


示例9: TestingTheUpdatedQualifier_Between

 public void TestingTheUpdatedQualifier_Between()
 {
     var connection = Substitute.For<IApiConnection>();
     var client = new SearchClient(connection);
     var request = new SearchRepositoriesRequest("github");
     request.Updated = DateRange.Between(new DateTime(2012, 4, 30), new DateTime(2012, 7, 4));
     client.SearchRepo(request);
     connection.Received().Get<SearchRepositoryResult>(Arg.Is<Uri>(u => u.ToString() == "search/repositories"),
         Arg.Is<Dictionary<string, string>>(d => d["q"] == "github+pushed:2012-04-30..2012-07-04"));
 }
开发者ID:naveensrinivasan,项目名称:octokit.net,代码行数:10,代码来源:SearchClientTests.cs


示例10: TestingTheCreatedQualifier_LessThanOrEquals

 public void TestingTheCreatedQualifier_LessThanOrEquals()
 {
     var connection = Substitute.For<IApiConnection>();
     var client = new SearchClient(connection);
     //get repos where the search contains 'github' and has been created after year jan 1 2011
     var request = new SearchRepositoriesRequest("github");
     request.Created = DateRange.LessThanOrEquals(new DateTime(2011, 1, 1));
     client.SearchRepo(request);
     connection.Received().Get<SearchRepositoryResult>(Arg.Is<Uri>(u => u.ToString() == "search/repositories"),
         Arg.Is<Dictionary<string, string>>(d => d["q"] == "github+created:<=2011-01-01"));
 }
开发者ID:naveensrinivasan,项目名称:octokit.net,代码行数:11,代码来源:SearchClientTests.cs


示例11: TestingTheInQualifier_Multiple

 public void TestingTheInQualifier_Multiple()
 {
     var connection = Substitute.For<IApiConnection>();
     var client = new SearchClient(connection);
     var request = new SearchRepositoriesRequest("github");
     request.In = new[] { InQualifier.Readme, InQualifier.Description, InQualifier.Name };
     client.SearchRepo(request);
     connection.Received().Get<SearchRepositoryResult>(
         Arg.Is<Uri>(u => u.ToString() == "search/repositories"),
         Arg.Is<Dictionary<string, string>>(d => d["q"] == "github+in:Readme,Description,Name"));
 }
开发者ID:naveensrinivasan,项目名称:octokit.net,代码行数:11,代码来源:SearchClientTests.cs


示例12: TestingTheForksQualifier

 public void TestingTheForksQualifier()
 {
     var connection = Substitute.For<IApiConnection>();
     var client = new SearchClient(connection);
     //get repos which has forks that are greater than 50
     var request = new SearchRepositoriesRequest("github");
     request.Forks = Range.GreaterThan(50);
     client.SearchRepo(request);
     connection.Received().Get<SearchRepositoryResult>(Arg.Is<Uri>(u => u.ToString() == "search/repositories"),
         Arg.Is<Dictionary<string, string>>(d => d["q"] == "github+forks:>50"));
 }
开发者ID:naveensrinivasan,项目名称:octokit.net,代码行数:11,代码来源:SearchClientTests.cs


示例13: TestingTheStarsQualifier_LessThanOrEquals

 public void TestingTheStarsQualifier_LessThanOrEquals()
 {
     var connection = Substitute.For<IApiConnection>();
     var client = new SearchClient(connection);
     //get repos whos stargazers are less than 500 or equal to
     var request = new SearchRepositoriesRequest("github");
     request.Stars = Range.LessThanOrEquals(500);
     client.SearchRepo(request);
     connection.Received().Get<SearchRepositoryResult>(
         Arg.Is<Uri>(u => u.ToString() == "search/repositories"),
         Arg.Is<Dictionary<string, string>>(d => d["q"] == "github+stars:<=500"));
 }
开发者ID:naveensrinivasan,项目名称:octokit.net,代码行数:12,代码来源:SearchClientTests.cs


示例14: TestingTheSizeQualifier

 public void TestingTheSizeQualifier()
 {
     var connection = Substitute.For<IApiConnection>();
     var client = new SearchClient(connection);
     var request = new SearchRepositoriesRequest("github");
     request.Size = Range.GreaterThan(1);
     client.SearchRepo(request);
     connection.Received().Get<SearchRepositoryResult>(
         Arg.Is<Uri>(u => u.ToString() == "search/repositories"),
         Arg.Is<Dictionary<string, string>>(d => d["q"] == "github+size:>1"));
 }
开发者ID:naveensrinivasan,项目名称:octokit.net,代码行数:11,代码来源:SearchClientTests.cs


示例15: TestingTheInQualifier

            public void TestingTheInQualifier()
            {
                var connection = Substitute.For<IApiConnection>();
                var client = new SearchClient(connection);
                //get repos where the Description contains the test 'github'
                var request = new SearchRepositoriesRequest("github");
                request.In = new[] { InQualifier.Description };
                client.SearchRepo(request);

                connection.Received().Get<SearchRepositoryResult>(Arg.Is<Uri>(u => u.ToString() == "search/repositories"), Arg.Any<Dictionary<string, string>>());
            }
开发者ID:nsavga,项目名称:octokit.net,代码行数:11,代码来源:SearchClientTests.cs


示例16: TestingTheUserQualifier

 public void TestingTheUserQualifier()
 {
     var connection = Substitute.For<IApiConnection>();
     var client = new SearchClient(connection);
     //get repos where search contains 'github' and user/org is 'github'
     var request = new SearchRepositoriesRequest("github");
     request.User = "rails";
     client.SearchRepo(request);
     connection.Received().Get<SearchRepositoryResult>(Arg.Is<Uri>(u => u.ToString() == "search/repositories"),
         Arg.Is<Dictionary<string, string>>(d => d["q"] == "github+user:rails"));
 }
开发者ID:naveensrinivasan,项目名称:octokit.net,代码行数:11,代码来源:SearchClientTests.cs


示例17: TestingTheUpdatedQualifier

            public void TestingTheUpdatedQualifier()
            {
                var connection = Substitute.For<IApiConnection>();
                var client = new SearchClient(connection);
                //get repos where the search contains 'github' and has been pushed before year jan 1 2013
                var request = new SearchRepositoriesRequest("github");
                request.Updated = DateRange.LessThan(new DateTime(2013, 1, 1));

                client.SearchRepo(request);

                connection.Received().Get<SearchRepositoryResult>(Arg.Is<Uri>(u => u.ToString() == "search/repositories"), Arg.Any<Dictionary<string, string>>());
            }
开发者ID:nsavga,项目名称:octokit.net,代码行数:12,代码来源:SearchClientTests.cs


示例18: TestingTheSortParameter

 public void TestingTheSortParameter()
 {
     var connection = Substitute.For<IApiConnection>();
     var client = new SearchClient(connection);
     var request = new SearchRepositoriesRequest("github");
     request.SortField = RepoSearchSort.Stars;
     
     client.SearchRepo(request);
     
     connection.Received().Get<SearchRepositoryResult>(
         Arg.Is<Uri>(u => u.ToString() == "search/repositories"),
         Arg.Is<Dictionary<string, string>>(d => 
             d["q"] == "github" &&
             d["sort"] == "stars"));
 }
开发者ID:naveensrinivasan,项目名称:octokit.net,代码行数:15,代码来源:SearchClientTests.cs


示例19: SearchRepo

 /// <summary>
 /// search repos
 /// http://developer.github.com/v3/search/#search-repositories
 /// </summary>
 /// <param name="request"></param>
 /// <returns>List of repositories</returns>
 public IObservable<Repository> SearchRepo(SearchRepositoriesRequest request)
 {
     Ensure.ArgumentNotNull(request, "request");
     return _connection.GetAndFlattenAllPages<Repository>(ApiUrls.SearchRepositories(), request.Parameters);
 }
开发者ID:rgmills,项目名称:octokit.net,代码行数:11,代码来源:ObservableSearchClient.cs


示例20: TestingTheCreatedQualifier

            public void TestingTheCreatedQualifier()
            {
                var connection = Substitute.For<IApiConnection>();
                var client = new SearchClient(connection);
                //get repos where the search contains 'github' and has been created after year jan 1 2011
                var request = new SearchRepositoriesRequest("github");
                request.Created = DateRange.GreaterThan(new DateTime(2011, 1, 1));

                client.SearchRepo(request);

                connection.Received().GetAll<Repository>(Arg.Is<Uri>(u => u.ToString() == "search/repositories"), Arg.Any<Dictionary<string, string>>());
            }
开发者ID:rgmills,项目名称:octokit.net,代码行数:12,代码来源:SearchClientTests.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# SearchResult类代码示例发布时间:2022-05-24
下一篇:
C# SearchParameters类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap