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


C# SearchRepositoriesRequest类代码示例

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


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


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