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


C# SearchClient.SearchRepo方法代码示例

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


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

示例1: RequestsTheCorrectUrl

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

示例2: 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

示例3: EnsuresNonNullArguments

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

示例4: 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

示例5: 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

示例6: 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

示例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: 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

示例9: 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

示例10: 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

示例11: 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

示例12: 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

示例13: EnsuresNonNullArguments

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

示例14: 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

示例15: 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


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