當前位置: 首頁>>代碼示例>>C#>>正文


C# Reactive.ObservablePullRequestsClient類代碼示例

本文整理匯總了C#中Octokit.Reactive.ObservablePullRequestsClient的典型用法代碼示例。如果您正苦於以下問題:C# ObservablePullRequestsClient類的具體用法?C# ObservablePullRequestsClient怎麽用?C# ObservablePullRequestsClient使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


ObservablePullRequestsClient類屬於Octokit.Reactive命名空間,在下文中一共展示了ObservablePullRequestsClient類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: ObservableRepositoriesClient

        public ObservableRepositoriesClient(IGitHubClient client)
        {
            Ensure.ArgumentNotNull(client, "client");

            _client = client.Repository;
            _connection = client.Connection;
            Status = new ObservableCommitStatusClient(client);
            Hooks = new ObservableRepositoryHooksClient(client);
            Forks = new ObservableRepositoryForksClient(client);
#pragma warning disable CS0618 // Type or member is obsolete
            RepoCollaborators = new ObservableRepoCollaboratorsClient(client);
#pragma warning restore CS0618 // Type or member is obsolete
            Collaborator = new ObservableRepoCollaboratorsClient(client);
            Deployment = new ObservableDeploymentsClient(client);
            Statistics = new ObservableStatisticsClient(client);
            PullRequest = new ObservablePullRequestsClient(client);
#pragma warning disable CS0618 // Type or member is obsolete
            RepositoryComments = new ObservableRepositoryCommentsClient(client);
#pragma warning restore CS0618 // Type or member is obsolete
            Comment = new ObservableRepositoryCommentsClient(client);
#pragma warning disable CS0618 // Type or member is obsolete
            Commits = new ObservableRepositoryCommitsClient(client);
#pragma warning restore CS0618 // Type or member is obsolete
            Commit = new ObservableRepositoryCommitsClient(client);
            Release = new ObservableReleasesClient(client);
            DeployKeys = new ObservableRepositoryDeployKeysClient(client);
            Content = new ObservableRepositoryContentsClient(client);
            Merging = new ObservableMergingClient(client);
            Page = new ObservableRepositoryPagesClient(client);
        }
開發者ID:KonstantinDavidov,項目名稱:octokit.net,代碼行數:30,代碼來源:ObservableRepositoriesClient.cs

示例2: GetsFromClientRepositoryPullRequest

            public void GetsFromClientRepositoryPullRequest()
            {
                var gitHubClient = Substitute.For<IGitHubClient>();
                var client = new ObservablePullRequestsClient(gitHubClient);

                client.Get("fake", "repo", 42);

                gitHubClient.Repository.PullRequest.Received().Get("fake", "repo", 42);
            }
開發者ID:cloudRoutine,項目名稱:octokit.net,代碼行數:9,代碼來源:ObservablePullRequestsClientTests.cs

示例3: EnsuresNonNullArguments

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

                await Assert.ThrowsAsync<ArgumentNullException>(() => client.Get(null, "name", 1).ToTask());
                await Assert.ThrowsAsync<ArgumentNullException>(() => client.Get("owner", null, 1).ToTask());
                await Assert.ThrowsAsync<ArgumentNullException>(() => client.Get(null, "", 1).ToTask());
                await Assert.ThrowsAsync<ArgumentException>(() => client.Get("", null, 1).ToTask());
            }
開發者ID:cloudRoutine,項目名稱:octokit.net,代碼行數:9,代碼來源:ObservablePullRequestsClientTests.cs

示例4: RequestsCorrectUrlWithRepositoryId

            public void RequestsCorrectUrlWithRepositoryId()
            {
                var gitHubClient = Substitute.For<IGitHubClient>();
                var client = new ObservablePullRequestsClient(gitHubClient);

                client.GetAllForRepository(1);

                gitHubClient.Received().PullRequest.GetAllForRepository(1);
            }
開發者ID:daveaglick,項目名稱:octokit.net,代碼行數:9,代碼來源:ObservablePullRequestsClientTests.cs

示例5: SendsAppropriateParameters

            public void SendsAppropriateParameters()
            {
                var gitHubClient = Substitute.For<IGitHubClient>();
                var client = new ObservablePullRequestsClient(gitHubClient);

                var pullRequestRequest = new PullRequestRequest { SortDirection = SortDirection.Descending };
                client.GetAllForRepository("fake", "repo", pullRequestRequest);

                gitHubClient.Received().PullRequest.GetAllForRepository("fake", "repo", pullRequestRequest, Args.ApiOptions);
            }
開發者ID:jrusbatch,項目名稱:octokit.net,代碼行數:10,代碼來源:ObservablePullRequestsClientTests.cs

示例6: ObservableRepositoriesClient

 public ObservableRepositoriesClient(IGitHubClient client)
 {
     Ensure.ArgumentNotNull(client, "client");
     
     _client = client.Repository;
     _connection = client.Connection;
     CommitStatus = new ObservableCommitStatusClient(client);
     RepoCollaborators = new ObservableRepoCollaboratorsClient(client);
     Deployment = new ObservableDeploymentsClient(client);
     Statistics = new ObservableStatisticsClient(client);
     PullRequest = new ObservablePullRequestsClient(client);
 }
開發者ID:Therzok,項目名稱:octokit.net,代碼行數:12,代碼來源:ObservableRepositoriesClient.cs

示例7: ReturnsEveryPageOfPullRequests

            public void ReturnsEveryPageOfPullRequests()
            {
                var firstPageUrl = new Uri("repos/fake/repo/pulls", UriKind.Relative);
                var secondPageUrl = new Uri("https://example.com/page/2");
                var firstPageLinks = new Dictionary<string, Uri> { { "next", secondPageUrl } };
                var firstPageResponse = new ApiResponse<List<PullRequest>>
                {
                    BodyAsObject = new List<PullRequest>
                    {
                        new PullRequest {Number = 1},
                        new PullRequest {Number = 2},
                        new PullRequest {Number = 3},
                    },
                    ApiInfo = CreateApiInfo(firstPageLinks)
                };
                var thirdPageUrl = new Uri("https://example.com/page/3");
                var secondPageLinks = new Dictionary<string, Uri> { { "next", thirdPageUrl } };
                var secondPageResponse = new ApiResponse<List<PullRequest>>
                {
                    BodyAsObject = new List<PullRequest>
                    {
                        new PullRequest {Number = 4},
                        new PullRequest {Number = 5},
                        new PullRequest {Number = 6},
                    },
                    ApiInfo = CreateApiInfo(secondPageLinks)
                };
                var lastPageResponse = new ApiResponse<List<PullRequest>>
                {
                    BodyAsObject = new List<PullRequest>
                    {
                        new PullRequest {Number = 7},
                    },
                    ApiInfo = CreateApiInfo(new Dictionary<string, Uri>())
                };
                var gitHubClient = Substitute.For<IGitHubClient>();
                gitHubClient.Connection.Get<List<PullRequest>>(firstPageUrl, null, null)
                    .Returns(Task.Factory.StartNew<IResponse<List<PullRequest>>>(() => firstPageResponse));
                gitHubClient.Connection.Get<List<PullRequest>>(secondPageUrl, null, null)
                    .Returns(Task.Factory.StartNew<IResponse<List<PullRequest>>>(() => secondPageResponse));
                gitHubClient.Connection.Get<List<PullRequest>>(thirdPageUrl, null, null)
                    .Returns(Task.Factory.StartNew<IResponse<List<PullRequest>>>(() => lastPageResponse));
                var client = new ObservablePullRequestsClient(gitHubClient);

                var results = client.GetForRepository("fake", "repo").ToArray().Wait();

                Assert.Equal(7, results.Length);
                Assert.Equal(firstPageResponse.BodyAsObject[0].Number, results[0].Number);
                Assert.Equal(secondPageResponse.BodyAsObject[1].Number, results[4].Number);
                Assert.Equal(lastPageResponse.BodyAsObject[0].Number, results[6].Number);
            }
開發者ID:Feng2012,項目名稱:octokit.net,代碼行數:51,代碼來源:ObservablePullRequestsClientTests.cs

示例8: RequestsCorrectUrlWithApiOptions

            public void RequestsCorrectUrlWithApiOptions()
            {
                var gitHubClient = Substitute.For<IGitHubClient>();
                var client = new ObservablePullRequestsClient(gitHubClient);

                var options = new ApiOptions
                {
                    PageCount = 1,
                    PageSize = 1,
                    StartPage = 1
                };

                client.GetAllForRepository("fake", "repo", options);

                gitHubClient.Received().PullRequest.GetAllForRepository("fake", "repo", options);
            }
開發者ID:daveaglick,項目名稱:octokit.net,代碼行數:16,代碼來源:ObservablePullRequestsClientTests.cs

示例9: ObservableGitHubClient

        public ObservableGitHubClient(IGitHubClient gitHubClient)
        {
            Ensure.ArgumentNotNull(gitHubClient, "githubClient");

            _gitHubClient = gitHubClient;
            Authorization = new ObservableAuthorizationsClient(gitHubClient);
            Activity = new ObservableActivitiesClient(gitHubClient);
            Issue = new ObservableIssuesClient(gitHubClient);
            Miscellaneous = new ObservableMiscellaneousClient(gitHubClient.Miscellaneous);
            Notification = new ObservableNotificationsClient(gitHubClient);
            Oauth = new ObservableOauthClient(gitHubClient);
            Organization = new ObservableOrganizationsClient(gitHubClient);
            PullRequest = new ObservablePullRequestsClient(gitHubClient);
            Repository = new ObservableRepositoriesClient(gitHubClient);
            SshKey = new ObservableSshKeysClient(gitHubClient);
            User = new ObservableUsersClient(gitHubClient);
            Git = new ObservableGitDatabaseClient(gitHubClient);
            Gist = new ObservableGistsClient(gitHubClient);
            Search = new ObservableSearchClient(gitHubClient);
        }
開發者ID:somedave-octokit,項目名稱:octokit.net,代碼行數:20,代碼來源:ObservableGitHubClient.cs

示例10: ObservableRepositoriesClient

        public ObservableRepositoriesClient(IGitHubClient client)
        {
            Ensure.ArgumentNotNull(client, "client");

            _client = client.Repository;
            _connection = client.Connection;
            Status = new ObservableCommitStatusClient(client);
            Hooks = new ObservableRepositoryHooksClient(client);
            Forks = new ObservableRepositoryForksClient(client);
            Collaborator = new ObservableRepoCollaboratorsClient(client);
            Deployment = new ObservableDeploymentsClient(client);
            Statistics = new ObservableStatisticsClient(client);
            PullRequest = new ObservablePullRequestsClient(client);
            Comment = new ObservableRepositoryCommentsClient(client);
            Commit = new ObservableRepositoryCommitsClient(client);
            Release = new ObservableReleasesClient(client);
            DeployKeys = new ObservableRepositoryDeployKeysClient(client);
            Content = new ObservableRepositoryContentsClient(client);
            Merging = new ObservableMergingClient(client);
            Page = new ObservableRepositoryPagesClient(client);
            Invitation = new ObservableRepositoryInvitationsClient(client);
        }
開發者ID:rlugojr,項目名稱:octokit.net,代碼行數:22,代碼來源:ObservableRepositoriesClient.cs

示例11: FetchesAllCommitsForPullRequest

            public async Task FetchesAllCommitsForPullRequest()
            {
                var commit = new PullRequestCommit(null, null, null, null, null, Enumerable.Empty<GitReference>(), null, null);
                var expectedUrl = string.Format("repos/fake/repo/pulls/42/commits");
                var gitHubClient = Substitute.For<IGitHubClient>();
                var connection = Substitute.For<IConnection>();
                IApiResponse<List<PullRequestCommit>> response = new ApiResponse<List<PullRequestCommit>>
                (
                    new Response(),
                    new List<PullRequestCommit> { commit }
                );
                connection.Get<List<PullRequestCommit>>(Args.Uri, null, null)
                    .Returns(Task.FromResult(response));
                gitHubClient.Connection.Returns(connection);
                var client = new ObservablePullRequestsClient(gitHubClient);

                var commits = await client.Commits("fake", "repo", 42).ToList();

                Assert.Equal(1, commits.Count);
                Assert.Same(commit, commits[0]);
                connection.Received().Get<List<PullRequestCommit>>(new Uri(expectedUrl, UriKind.Relative), null, null);
            }
開發者ID:cloudRoutine,項目名稱:octokit.net,代碼行數:22,代碼來源:ObservablePullRequestsClientTests.cs

示例12: PullRequestMerged

            public void PullRequestMerged()
            {
                var gitHubClient = Substitute.For<IGitHubClient>();
                var client = new ObservablePullRequestsClient(gitHubClient);

                client.Merged("fake", "repo", 42);

                gitHubClient.Repository.PullRequest.Received().Merged("fake", "repo", 42);
            }
開發者ID:cloudRoutine,項目名稱:octokit.net,代碼行數:9,代碼來源:ObservablePullRequestsClientTests.cs

示例13: MergesPullRequest

            public void MergesPullRequest()
            {
                var mergePullRequest = new MergePullRequest { CommitMessage = "fake commit message" };
                var gitHubClient = Substitute.For<IGitHubClient>();
                var client = new ObservablePullRequestsClient(gitHubClient);

                client.Merge("fake", "repo", 42, mergePullRequest);

                gitHubClient.Repository.PullRequest.Received().Merge("fake", "repo", 42, mergePullRequest);
            }
開發者ID:cloudRoutine,項目名稱:octokit.net,代碼行數:10,代碼來源:ObservablePullRequestsClientTests.cs

示例14: EnsuresArgumentsNotNull

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

                await Assert.ThrowsAsync<ArgumentNullException>(() =>
                    client.Create(null, "name", new NewPullRequest("title", "ref", "ref2")).ToTask());
                await Assert.ThrowsAsync<ArgumentException>(() =>
                    client.Create("", "name", new NewPullRequest("title", "ref", "ref2")).ToTask());
                await Assert.ThrowsAsync<ArgumentNullException>(() =>
                    client.Create("owner", null, new NewPullRequest("title", "ref", "ref2")).ToTask());
                await Assert.ThrowsAsync<ArgumentException>(() =>
                    client.Create("owner", "", new NewPullRequest("title", "ref", "ref2")).ToTask());
                await Assert.ThrowsAsync<ArgumentNullException>(() =>
                    client.Create("owner", "name", null).ToTask());
            }
開發者ID:cloudRoutine,項目名稱:octokit.net,代碼行數:16,代碼來源:ObservablePullRequestsClientTests.cs

示例15: UpdatesClientRepositoryPullRequest

            public void UpdatesClientRepositoryPullRequest()
            {
                var pullRequestUpdate = new PullRequestUpdate();
                var gitHubClient = Substitute.For<IGitHubClient>();
                var client = new ObservablePullRequestsClient(gitHubClient);

                client.Update("fake", "repo", 42, pullRequestUpdate);

                gitHubClient.Repository.PullRequest.Received().Update("fake", "repo", 42, pullRequestUpdate);
            }
開發者ID:cloudRoutine,項目名稱:octokit.net,代碼行數:10,代碼來源:ObservablePullRequestsClientTests.cs


注:本文中的Octokit.Reactive.ObservablePullRequestsClient類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。