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


C# ObservableRepositoriesClient.Get方法代码示例

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


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

示例1: RequestsCorrectUrlWithRepositoryId

            public async Task RequestsCorrectUrlWithRepositoryId()
            {
                var gitHubClient = Substitute.For<IGitHubClient>();
                var client = new ObservableRepositoriesClient(gitHubClient);

                await client.Get(1);

                gitHubClient.Repository.Get(1);
            }
开发者ID:RadicalLove,项目名称:octokit.net,代码行数:9,代码来源:ObservableRepositoriesClientTests.cs

示例2: RequestsCorrectUrl

            public async Task RequestsCorrectUrl()
            {
                var gitHubClient = Substitute.For<IGitHubClient>();
                var client = new ObservableRepositoriesClient(gitHubClient);

                await client.Get("owner", "name");

                gitHubClient.Received().Repository.Get("owner", "name");
            }
开发者ID:RadicalLove,项目名称:octokit.net,代码行数:9,代码来源:ObservableRepositoriesClientTests.cs

示例3: ReturnsSpecifiedRepository

            public async Task ReturnsSpecifiedRepository()
            {
                var github = Helper.GetAuthenticatedClient();

                var client = new ObservableRepositoriesClient(github);
                var observable = client.Get("haacked", "seegit");
                var repository = await observable;
                var repository2 = await observable;

                Assert.Equal("https://github.com/Haacked/SeeGit.git", repository.CloneUrl);
                Assert.False(repository.Private);
                Assert.False(repository.Fork);
                Assert.Equal("https://github.com/Haacked/SeeGit.git", repository2.CloneUrl);
                Assert.False(repository2.Private);
                Assert.False(repository2.Fork);
            }
开发者ID:daveaglick,项目名称:octokit.net,代码行数:16,代码来源:ObservableRepositoriesClientTests.cs

示例4: ReturnsSpecifiedRepository

            public async Task ReturnsSpecifiedRepository()
            {
                var github = new GitHubClient(new ProductHeaderValue("OctokitTests"))
                {
                    Credentials = Helper.Credentials
                };
                var client = new ObservableRepositoriesClient(github);
                var observable = client.Get("haacked", "seegit");
                var repository = await observable;
                var repository2 = await observable;

                Assert.Equal("https://github.com/Haacked/SeeGit.git", repository.CloneUrl);
                Assert.False(repository.Private);
                Assert.False(repository.Fork);
                Assert.Equal("https://github.com/Haacked/SeeGit.git", repository2.CloneUrl);
                Assert.False(repository2.Private);
                Assert.False(repository2.Fork);
            }
开发者ID:harunpehlivan,项目名称:octokit.net,代码行数:18,代码来源:ObservableRepositoriesClientTests.cs

示例5: IsALukeWarmObservable

            public async Task IsALukeWarmObservable()
            {
                var repository = new Repository();
                var response = Task.Factory.StartNew<IResponse<Repository>>(() =>
                    new ApiResponse<Repository> { BodyAsObject = repository });
                var connection = Substitute.For<IConnection>();
                connection.GetAsync<Repository>(Args.Uri, null, null).Returns(response);
                var gitHubClient = new GitHubClient(connection);
                var client = new ObservableRepositoriesClient(gitHubClient);
                var observable = client.Get("stark", "ned");
                connection.Received(0).GetAsync<Repository>(Args.Uri);

                var result = await observable;
                connection.Received(1).GetAsync<Repository>(Args.Uri, null, null);
                var result2 = await observable;
                // TODO: If we change this to a warm observable, we'll need to change this to Received(2)
                connection.Received(1).GetAsync<Repository>(Args.Uri, null, null);

                Assert.Same(repository, result);
                Assert.Same(repository, result2);
            }
开发者ID:Techie123,项目名称:octokit.net,代码行数:21,代码来源:ObservableRepositoriesClientTests.cs

示例6: EnsuresNonNullArguments

            public async Task EnsuresNonNullArguments()
            {
                var client = new ObservableRepositoriesClient(Substitute.For<IGitHubClient>());

                Assert.Throws<ArgumentNullException>(() => client.Get(null, "name"));
                Assert.Throws<ArgumentNullException>(() => client.Get("owner", null));

                Assert.Throws<ArgumentException>(() => client.Get("", "name"));
                Assert.Throws<ArgumentException>(() => client.Get("owner", ""));
            }
开发者ID:RadicalLove,项目名称:octokit.net,代码行数:10,代码来源:ObservableRepositoriesClientTests.cs

示例7: IsALukeWarmObservable

            public async Task IsALukeWarmObservable()
            {
                var repository = new Repository();
                var response = Task.Factory.StartNew<IApiResponse<Repository>>(() =>
                    new ApiResponse<Repository>(new Response(), repository));
                var connection = Substitute.For<IConnection>();
                connection.Get<Repository>(Args.Uri, null, "application/vnd.github.polaris-preview+json").Returns(response);
                var gitHubClient = new GitHubClient(connection);
                var client = new ObservableRepositoriesClient(gitHubClient);
                var observable = client.Get("stark", "ned");

                connection.Received(1).Get<Repository>(Args.Uri, null, "application/vnd.github.polaris-preview+json");

                var result = await observable;
                connection.Received(1).Get<Repository>(Args.Uri, null, "application/vnd.github.polaris-preview+json");
                var result2 = await observable;
                // TODO: If we change this to a warm observable, we'll need to change this to Received(2)
                connection.Received(1).Get<Repository>(Args.Uri, null, "application/vnd.github.polaris-preview+json");

                Assert.Same(repository, result);
                Assert.Same(repository, result2);
            }
开发者ID:daveaglick,项目名称:octokit.net,代码行数:22,代码来源:ObservableRepositoriesClientTests.cs


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