當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。