From 6e581f5155dfa353c6419a4ddd4e7f8bcae685e9 Mon Sep 17 00:00:00 2001 From: Chris Simpson Date: Tue, 26 Jul 2022 19:04:11 +0100 Subject: [PATCH 1/4] Making a first stab. Removing everything I think I can, but tests aren't working yet. Need some more advice. --- ...eEnterprisePreReceiveEnvironmentsClient.cs | 2 +- .../Clients/ObservableCheckRunsClient.cs | 12 +- .../Clients/ObservableCheckSuitesClient.cs | 4 +- .../ObservableCommitCommentReactionsClient.cs | 4 +- .../ObservableGitHubAppInstallationsClient.cs | 4 +- .../Clients/ObservableGitHubAppsClient.cs | 6 +- .../ObservableIssueCommentReactionsClient.cs | 4 +- .../Clients/ObservableIssueCommentsClient.cs | 8 +- .../Clients/ObservableIssueReactionsClient.cs | 4 +- .../Clients/ObservableIssueTimelineClient.cs | 4 +- .../Clients/ObservableIssuesClient.cs | 8 +- .../Clients/ObservableMigrationsClient.cs | 2 +- .../ObservableOrganizationMembersClient.cs | 2 +- ...eOrganizationOutsideCollaboratorsClient.cs | 4 +- .../Clients/ObservableProjectCardsClient.cs | 2 +- .../Clients/ObservableProjectColumnsClient.cs | 2 +- .../Clients/ObservableProjectsClient.cs | 12 +- ...PullRequestReviewCommentReactionsClient.cs | 4 +- ...servablePullRequestReviewCommentsClient.cs | 11 +- .../Clients/ObservablePullRequestsClient.cs | 8 +- .../ObservableRepositoryCommentsClient.cs | 8 +- .../Clients/ObservableStarredClient.cs | 12 +- .../Clients/ObservableTeamsClient.cs | 2 +- Octokit.Tests.Integration/Helper.cs | 2 +- Octokit.Tests/Clients/CheckRunsClientTests.cs | 34 +--- .../Clients/CheckSuitesClientTests.cs | 10 +- Octokit/Clients/AssigneesClient.cs | 4 +- Octokit/Clients/AuthorizationsClient.cs | 8 +- Octokit/Clients/CheckRunsClient.cs | 36 ++-- Octokit/Clients/CheckSuitesClient.cs | 30 +-- .../Clients/CommitCommentReactionsClient.cs | 12 +- Octokit/Clients/DeploymentStatusClient.cs | 26 +-- Octokit/Clients/DeploymentsClient.cs | 11 +- .../EnterprisePreReceiveEnvironmentsClient.cs | 14 +- .../Clients/GitHubAppInstallationsClient.cs | 6 +- Octokit/Clients/GitHubAppsClient.cs | 33 ++-- .../Clients/IssueCommentReactionsClient.cs | 12 +- Octokit/Clients/IssueCommentsClient.cs | 18 +- Octokit/Clients/IssueReactionsClient.cs | 12 +- Octokit/Clients/IssueTimelineClient.cs | 14 +- Octokit/Clients/IssuesClient.cs | 21 +-- Octokit/Clients/IssuesEventsClient.cs | 34 +--- Octokit/Clients/MigrationsClient.cs | 18 +- Octokit/Clients/OrganizationMembersClient.cs | 2 +- .../OrganizationOutsideCollaboratorsClient.cs | 8 +- Octokit/Clients/ProjectCardsClient.cs | 18 +- Octokit/Clients/ProjectColumnsClient.cs | 18 +- Octokit/Clients/ProjectsClient.cs | 33 ++-- ...PullRequestReviewCommentReactionsClient.cs | 12 +- .../PullRequestReviewCommentsClient.cs | 12 +- Octokit/Clients/PullRequestsClient.cs | 26 +-- Octokit/Clients/ReactionsClient.cs | 3 +- Octokit/Clients/RepoCollaboratorsClient.cs | 4 +- Octokit/Clients/RepositoriesClient.cs | 43 ++--- Octokit/Clients/RepositoryBranchesClient.cs | 171 ++++++------------ Octokit/Clients/RepositoryCommentsClient.cs | 18 +- Octokit/Clients/RepositoryCommitsClient.cs | 4 +- Octokit/Clients/RepositoryForksClient.cs | 2 - Octokit/Clients/StarredClient.cs | 12 +- Octokit/Clients/TeamsClient.cs | 2 +- Octokit/Helpers/AcceptHeaders.cs | 59 +----- Octokit/Helpers/PreviewAttribute.cs | 20 -- 62 files changed, 295 insertions(+), 656 deletions(-) delete mode 100644 Octokit/Helpers/PreviewAttribute.cs diff --git a/Octokit.Reactive/Clients/Enterprise/ObservableEnterprisePreReceiveEnvironmentsClient.cs b/Octokit.Reactive/Clients/Enterprise/ObservableEnterprisePreReceiveEnvironmentsClient.cs index f49b337c06..009983feb2 100644 --- a/Octokit.Reactive/Clients/Enterprise/ObservableEnterprisePreReceiveEnvironmentsClient.cs +++ b/Octokit.Reactive/Clients/Enterprise/ObservableEnterprisePreReceiveEnvironmentsClient.cs @@ -48,7 +48,7 @@ public IObservable GetAll(ApiOptions options) { Ensure.ArgumentNotNull(options, nameof(options)); - return _connection.GetAndFlattenAllPages(ApiUrls.AdminPreReceiveEnvironments(), null, AcceptHeaders.PreReceiveEnvironmentsPreview, options); + return _connection.GetAndFlattenAllPages(ApiUrls.AdminPreReceiveEnvironments(), null, options); } /// diff --git a/Octokit.Reactive/Clients/ObservableCheckRunsClient.cs b/Octokit.Reactive/Clients/ObservableCheckRunsClient.cs index ee5ebb5f03..d90dbd3929 100644 --- a/Octokit.Reactive/Clients/ObservableCheckRunsClient.cs +++ b/Octokit.Reactive/Clients/ObservableCheckRunsClient.cs @@ -184,7 +184,7 @@ public IObservable GetAllForReference(string owner, string na Ensure.ArgumentNotNull(checkRunRequest, nameof(checkRunRequest)); Ensure.ArgumentNotNull(options, nameof(options)); - return _connection.GetAndFlattenAllPages(ApiUrls.CheckRunsForReference(owner, name, reference), checkRunRequest.ToParametersDictionary(), AcceptHeaders.ChecksApiPreview, options); + return _connection.GetAndFlattenAllPages(ApiUrls.CheckRunsForReference(owner, name, reference), checkRunRequest.ToParametersDictionary(), options); } /// @@ -203,7 +203,7 @@ public IObservable GetAllForReference(long repositoryId, stri Ensure.ArgumentNotNull(checkRunRequest, nameof(checkRunRequest)); Ensure.ArgumentNotNull(options, nameof(options)); - return _connection.GetAndFlattenAllPages(ApiUrls.CheckRunsForReference(repositoryId, reference), checkRunRequest.ToParametersDictionary(), AcceptHeaders.ChecksApiPreview, options); + return _connection.GetAndFlattenAllPages(ApiUrls.CheckRunsForReference(repositoryId, reference), checkRunRequest.ToParametersDictionary(), options); } /// @@ -289,7 +289,7 @@ public IObservable GetAllForCheckSuite(string owner, string n Ensure.ArgumentNotNull(checkRunRequest, nameof(checkRunRequest)); Ensure.ArgumentNotNull(options, nameof(options)); - return _connection.GetAndFlattenAllPages(ApiUrls.CheckRunsForCheckSuite(owner, name, checkSuiteId), checkRunRequest.ToParametersDictionary(), AcceptHeaders.ChecksApiPreview, options); + return _connection.GetAndFlattenAllPages(ApiUrls.CheckRunsForCheckSuite(owner, name, checkSuiteId), checkRunRequest.ToParametersDictionary(), options); } /// @@ -307,7 +307,7 @@ public IObservable GetAllForCheckSuite(long repositoryId, lon Ensure.ArgumentNotNull(checkRunRequest, nameof(checkRunRequest)); Ensure.ArgumentNotNull(options, nameof(options)); - return _connection.GetAndFlattenAllPages(ApiUrls.CheckRunsForCheckSuite(repositoryId, checkSuiteId), checkRunRequest.ToParametersDictionary(), AcceptHeaders.ChecksApiPreview, options); + return _connection.GetAndFlattenAllPages(ApiUrls.CheckRunsForCheckSuite(repositoryId, checkSuiteId), checkRunRequest.ToParametersDictionary(), options); } /// @@ -387,7 +387,7 @@ public IObservable GetAllAnnotations(string owner, string na Ensure.ArgumentNotNullOrEmptyString(name, nameof(name)); Ensure.ArgumentNotNull(options, nameof(options)); - return _connection.GetAndFlattenAllPages(ApiUrls.CheckRunAnnotations(owner, name, checkRunId), null, AcceptHeaders.ChecksApiPreview, options); + return _connection.GetAndFlattenAllPages(ApiUrls.CheckRunAnnotations(owner, name, checkRunId), null, options); } /// @@ -403,7 +403,7 @@ public IObservable GetAllAnnotations(long repositoryId, long { Ensure.ArgumentNotNull(options, nameof(options)); - return _connection.GetAndFlattenAllPages(ApiUrls.CheckRunAnnotations(repositoryId, checkRunId), null, AcceptHeaders.ChecksApiPreview, options); + return _connection.GetAndFlattenAllPages(ApiUrls.CheckRunAnnotations(repositoryId, checkRunId), null, options); } } } diff --git a/Octokit.Reactive/Clients/ObservableCheckSuitesClient.cs b/Octokit.Reactive/Clients/ObservableCheckSuitesClient.cs index 4cd569c465..97b662ce18 100644 --- a/Octokit.Reactive/Clients/ObservableCheckSuitesClient.cs +++ b/Octokit.Reactive/Clients/ObservableCheckSuitesClient.cs @@ -146,7 +146,7 @@ public IObservable GetAllForReference(string owner, string Ensure.ArgumentNotNull(request, nameof(request)); Ensure.ArgumentNotNull(options, nameof(options)); - return _connection.GetAndFlattenAllPages(ApiUrls.CheckSuitesForReference(owner, name, reference), request.ToParametersDictionary(), AcceptHeaders.ChecksApiPreview, options); + return _connection.GetAndFlattenAllPages(ApiUrls.CheckSuitesForReference(owner, name, reference), request.ToParametersDictionary(), options); } /// @@ -165,7 +165,7 @@ public IObservable GetAllForReference(long repositoryId, st Ensure.ArgumentNotNull(request, nameof(request)); Ensure.ArgumentNotNull(options, nameof(options)); - return _connection.GetAndFlattenAllPages(ApiUrls.CheckSuitesForReference(repositoryId, reference), request.ToParametersDictionary(), AcceptHeaders.ChecksApiPreview, options); + return _connection.GetAndFlattenAllPages(ApiUrls.CheckSuitesForReference(repositoryId, reference), request.ToParametersDictionary(), options); } /// diff --git a/Octokit.Reactive/Clients/ObservableCommitCommentReactionsClient.cs b/Octokit.Reactive/Clients/ObservableCommitCommentReactionsClient.cs index c95814aeb7..7193521746 100644 --- a/Octokit.Reactive/Clients/ObservableCommitCommentReactionsClient.cs +++ b/Octokit.Reactive/Clients/ObservableCommitCommentReactionsClient.cs @@ -85,7 +85,7 @@ public IObservable GetAll(string owner, string name, int number, ApiOp Ensure.ArgumentNotNullOrEmptyString(name, nameof(name)); Ensure.ArgumentNotNull(options, nameof(options)); - return _connection.GetAndFlattenAllPages(ApiUrls.CommitCommentReactions(owner, name, number), null, AcceptHeaders.ReactionsPreview, options); + return _connection.GetAndFlattenAllPages(ApiUrls.CommitCommentReactions(owner, name, number), null, options); } /// @@ -112,7 +112,7 @@ public IObservable GetAll(long repositoryId, int number, ApiOptions op { Ensure.ArgumentNotNull(options, nameof(options)); - return _connection.GetAndFlattenAllPages(ApiUrls.CommitCommentReactions(repositoryId, number), null, AcceptHeaders.ReactionsPreview, options); + return _connection.GetAndFlattenAllPages(ApiUrls.CommitCommentReactions(repositoryId, number), null, options); } /// diff --git a/Octokit.Reactive/Clients/ObservableGitHubAppInstallationsClient.cs b/Octokit.Reactive/Clients/ObservableGitHubAppInstallationsClient.cs index df4a4a8a04..85371a9fcf 100644 --- a/Octokit.Reactive/Clients/ObservableGitHubAppInstallationsClient.cs +++ b/Octokit.Reactive/Clients/ObservableGitHubAppInstallationsClient.cs @@ -38,7 +38,7 @@ public IObservable GetAllRepositoriesForCurrent() /// https://developer.github.com/v3/apps/installations/#list-repositories public IObservable GetAllRepositoriesForCurrent(ApiOptions options) { - return _connection.GetAndFlattenAllPages(ApiUrls.InstallationRepositories(), null, AcceptHeaders.GitHubAppsPreview, options); + return _connection.GetAndFlattenAllPages(ApiUrls.InstallationRepositories(), null, options); } /// @@ -59,7 +59,7 @@ public IObservable GetAllRepositoriesForCurrentUser(long i /// https://developer.github.com/v3/apps/installations/#list-repositories-accessible-to-the-user-for-an-installation public IObservable GetAllRepositoriesForCurrentUser(long installationId, ApiOptions options) { - return _connection.GetAndFlattenAllPages(ApiUrls.UserInstallationRepositories(installationId), null, AcceptHeaders.GitHubAppsPreview, options); + return _connection.GetAndFlattenAllPages(ApiUrls.UserInstallationRepositories(installationId), null, options); } } } \ No newline at end of file diff --git a/Octokit.Reactive/Clients/ObservableGitHubAppsClient.cs b/Octokit.Reactive/Clients/ObservableGitHubAppsClient.cs index 5adc03aebe..22f3078815 100644 --- a/Octokit.Reactive/Clients/ObservableGitHubAppsClient.cs +++ b/Octokit.Reactive/Clients/ObservableGitHubAppsClient.cs @@ -72,7 +72,7 @@ public IObservable GetAllInstallationsForCurrent(ApiOptions option { Ensure.ArgumentNotNull(options, nameof(options)); - return _connection.GetAndFlattenAllPages(ApiUrls.Installations(), null, AcceptHeaders.GitHubAppsPreview, options); + return _connection.GetAndFlattenAllPages(ApiUrls.Installations(), null, options); } /// @@ -102,7 +102,7 @@ public IObservable GetInstallationForCurrent(long installationId) /// https://developer.github.com/v3/apps/#list-installations-for-user public IObservable GetAllInstallationsForCurrentUser() { - return _connection.GetAndFlattenAllPages(ApiUrls.UserInstallations(), null, AcceptHeaders.GitHubAppsPreview); + return _connection.GetAndFlattenAllPages(ApiUrls.UserInstallations()); } /// @@ -111,7 +111,7 @@ public IObservable GetAllInstallationsForCurrentUser() /// https://developer.github.com/v3/apps/#list-installations-for-user public IObservable GetAllInstallationsForCurrentUser(ApiOptions options) { - return _connection.GetAndFlattenAllPages(ApiUrls.UserInstallations(), null, AcceptHeaders.GitHubAppsPreview, options); + return _connection.GetAndFlattenAllPages(ApiUrls.UserInstallations(), null, options); } /// diff --git a/Octokit.Reactive/Clients/ObservableIssueCommentReactionsClient.cs b/Octokit.Reactive/Clients/ObservableIssueCommentReactionsClient.cs index 9a4d61cd04..d8753a093c 100644 --- a/Octokit.Reactive/Clients/ObservableIssueCommentReactionsClient.cs +++ b/Octokit.Reactive/Clients/ObservableIssueCommentReactionsClient.cs @@ -84,7 +84,7 @@ public IObservable GetAll(string owner, string name, int number, ApiOp Ensure.ArgumentNotNullOrEmptyString(name, nameof(name)); Ensure.ArgumentNotNull(options, nameof(options)); - return _connection.GetAndFlattenAllPages(ApiUrls.IssueCommentReactions(owner, name, number), null, AcceptHeaders.ReactionsPreview, options); + return _connection.GetAndFlattenAllPages(ApiUrls.IssueCommentReactions(owner, name, number), null, options); } /// @@ -109,7 +109,7 @@ public IObservable GetAll(long repositoryId, int number, ApiOptions op { Ensure.ArgumentNotNull(options, nameof(options)); - return _connection.GetAndFlattenAllPages(ApiUrls.IssueCommentReactions(repositoryId, number), null, AcceptHeaders.ReactionsPreview, options); + return _connection.GetAndFlattenAllPages(ApiUrls.IssueCommentReactions(repositoryId, number), null, options); } /// diff --git a/Octokit.Reactive/Clients/ObservableIssueCommentsClient.cs b/Octokit.Reactive/Clients/ObservableIssueCommentsClient.cs index e87c38bedd..fde616445a 100644 --- a/Octokit.Reactive/Clients/ObservableIssueCommentsClient.cs +++ b/Octokit.Reactive/Clients/ObservableIssueCommentsClient.cs @@ -147,7 +147,7 @@ public IObservable GetAllForRepository(string owner, string name, Ensure.ArgumentNotNull(request, nameof(request)); Ensure.ArgumentNotNull(options, nameof(options)); - return _connection.GetAndFlattenAllPages(ApiUrls.IssueComments(owner, name), request.ToParametersDictionary(), AcceptHeaders.ReactionsPreview, options); + return _connection.GetAndFlattenAllPages(ApiUrls.IssueComments(owner, name), request.ToParametersDictionary(), options); } /// @@ -162,7 +162,7 @@ public IObservable GetAllForRepository(long repositoryId, IssueCom Ensure.ArgumentNotNull(request, nameof(request)); Ensure.ArgumentNotNull(options, nameof(options)); - return _connection.GetAndFlattenAllPages(ApiUrls.IssueComments(repositoryId), request.ToParametersDictionary(), AcceptHeaders.ReactionsPreview, options); + return _connection.GetAndFlattenAllPages(ApiUrls.IssueComments(repositoryId), request.ToParametersDictionary(), options); } /// @@ -269,7 +269,7 @@ public IObservable GetAllForIssue(string owner, string name, int n Ensure.ArgumentNotNull(request, nameof(request)); Ensure.ArgumentNotNull(options, nameof(options)); - return _connection.GetAndFlattenAllPages(ApiUrls.IssueComments(owner, name, number), request.ToParametersDictionary(), AcceptHeaders.ReactionsPreview, options); + return _connection.GetAndFlattenAllPages(ApiUrls.IssueComments(owner, name, number), request.ToParametersDictionary(), options); } @@ -286,7 +286,7 @@ public IObservable GetAllForIssue(long repositoryId, int number, I Ensure.ArgumentNotNull(request, nameof(request)); Ensure.ArgumentNotNull(options, nameof(options)); - return _connection.GetAndFlattenAllPages(ApiUrls.IssueComments(repositoryId, number), request.ToParametersDictionary(), AcceptHeaders.ReactionsPreview, options); + return _connection.GetAndFlattenAllPages(ApiUrls.IssueComments(repositoryId, number), request.ToParametersDictionary(), options); } /// diff --git a/Octokit.Reactive/Clients/ObservableIssueReactionsClient.cs b/Octokit.Reactive/Clients/ObservableIssueReactionsClient.cs index 12da405811..8a9c451e3b 100644 --- a/Octokit.Reactive/Clients/ObservableIssueReactionsClient.cs +++ b/Octokit.Reactive/Clients/ObservableIssueReactionsClient.cs @@ -50,7 +50,7 @@ public IObservable GetAll(string owner, string name, int number, ApiOp Ensure.ArgumentNotNullOrEmptyString(name, nameof(name)); Ensure.ArgumentNotNull(options, nameof(options)); - return _connection.GetAndFlattenAllPages(ApiUrls.IssueReactions(owner, name, number), null, AcceptHeaders.ReactionsPreview, options); + return _connection.GetAndFlattenAllPages(ApiUrls.IssueReactions(owner, name, number), null, options); } /// @@ -75,7 +75,7 @@ public IObservable GetAll(long repositoryId, int number, ApiOptions op { Ensure.ArgumentNotNull(options, nameof(options)); - return _connection.GetAndFlattenAllPages(ApiUrls.IssueReactions(repositoryId, number), null, AcceptHeaders.ReactionsPreview, options); + return _connection.GetAndFlattenAllPages(ApiUrls.IssueReactions(repositoryId, number), null, options); } /// diff --git a/Octokit.Reactive/Clients/ObservableIssueTimelineClient.cs b/Octokit.Reactive/Clients/ObservableIssueTimelineClient.cs index efc0970157..d7017fd493 100644 --- a/Octokit.Reactive/Clients/ObservableIssueTimelineClient.cs +++ b/Octokit.Reactive/Clients/ObservableIssueTimelineClient.cs @@ -53,7 +53,7 @@ public IObservable GetAllForIssue(string owner, string repo, Ensure.ArgumentNotNullOrEmptyString(repo, nameof(repo)); Ensure.ArgumentNotNull(options, nameof(options)); - return _connection.GetAndFlattenAllPages(ApiUrls.IssueTimeline(owner, repo, number), null, AcceptHeaders.IssueTimelineApiPreview, options); + return _connection.GetAndFlattenAllPages(ApiUrls.IssueTimeline(owner, repo, number), null, options); } /// @@ -82,7 +82,7 @@ public IObservable GetAllForIssue(long repositoryId, int numb { Ensure.ArgumentNotNull(options, nameof(options)); - return _connection.GetAndFlattenAllPages(ApiUrls.IssueTimeline(repositoryId, number), null, AcceptHeaders.IssueTimelineApiPreview, options); + return _connection.GetAndFlattenAllPages(ApiUrls.IssueTimeline(repositoryId, number), null, options); } } } diff --git a/Octokit.Reactive/Clients/ObservableIssuesClient.cs b/Octokit.Reactive/Clients/ObservableIssuesClient.cs index fb38ed2134..3b96237c89 100644 --- a/Octokit.Reactive/Clients/ObservableIssuesClient.cs +++ b/Octokit.Reactive/Clients/ObservableIssuesClient.cs @@ -150,7 +150,7 @@ public IObservable GetAllForCurrent(IssueRequest request, ApiOptions opti Ensure.ArgumentNotNull(request, nameof(request)); Ensure.ArgumentNotNull(options, nameof(options)); - return _connection.GetAndFlattenAllPages(ApiUrls.Issues(), request.ToParametersDictionary(), AcceptHeaders.ReactionsPreview, options); + return _connection.GetAndFlattenAllPages(ApiUrls.Issues(), request.ToParametersDictionary(), options); } /// @@ -209,7 +209,7 @@ public IObservable GetAllForOwnedAndMemberRepositories(IssueRequest reque Ensure.ArgumentNotNull(request, nameof(request)); Ensure.ArgumentNotNull(options, nameof(options)); - return _connection.GetAndFlattenAllPages(ApiUrls.IssuesForOwnedAndMember(), request.ToParametersDictionary(), AcceptHeaders.ReactionsPreview, options); + return _connection.GetAndFlattenAllPages(ApiUrls.IssuesForOwnedAndMember(), request.ToParametersDictionary(), options); } /// @@ -273,7 +273,7 @@ public IObservable GetAllForOrganization(string organization, IssueReques Ensure.ArgumentNotNull(request, nameof(request)); Ensure.ArgumentNotNull(options, nameof(options)); - return _connection.GetAndFlattenAllPages(ApiUrls.Issues(organization), request.ToParametersDictionary(), AcceptHeaders.ReactionsPreview, options); + return _connection.GetAndFlattenAllPages(ApiUrls.Issues(organization), request.ToParametersDictionary(), options); } /// @@ -387,7 +387,7 @@ public IObservable GetAllForRepository(string owner, string name, Reposit Ensure.ArgumentNotNull(request, nameof(request)); Ensure.ArgumentNotNull(options, nameof(options)); - return _connection.GetAndFlattenAllPages(ApiUrls.Issues(owner, name), request.ToParametersDictionary(), AcceptHeaders.ReactionsPreview, options); + return _connection.GetAndFlattenAllPages(ApiUrls.Issues(owner, name), request.ToParametersDictionary(), options); } /// diff --git a/Octokit.Reactive/Clients/ObservableMigrationsClient.cs b/Octokit.Reactive/Clients/ObservableMigrationsClient.cs index 86f9c74766..41e7021ed6 100644 --- a/Octokit.Reactive/Clients/ObservableMigrationsClient.cs +++ b/Octokit.Reactive/Clients/ObservableMigrationsClient.cs @@ -62,7 +62,7 @@ public IObservable GetAll(string org, ApiOptions options) { Ensure.ArgumentNotNull(options, nameof(options)); - return _connection.GetAndFlattenAllPages(ApiUrls.EnterpriseMigrations(org), null, AcceptHeaders.MigrationsApiPreview, options); + return _connection.GetAndFlattenAllPages(ApiUrls.EnterpriseMigrations(org), null, options); } /// diff --git a/Octokit.Reactive/Clients/ObservableOrganizationMembersClient.cs b/Octokit.Reactive/Clients/ObservableOrganizationMembersClient.cs index 064403740b..bda101a24a 100644 --- a/Octokit.Reactive/Clients/ObservableOrganizationMembersClient.cs +++ b/Octokit.Reactive/Clients/ObservableOrganizationMembersClient.cs @@ -470,7 +470,7 @@ public IObservable GetAllPendingInvitations(st Ensure.ArgumentNotNullOrEmptyString(org, nameof(org)); Ensure.ArgumentNotNull(options, nameof(options)); - return _connection.GetAndFlattenAllPages(ApiUrls.OrganizationPendingInvititations(org), null, AcceptHeaders.OrganizationMembershipPreview, options); + return _connection.GetAndFlattenAllPages(ApiUrls.OrganizationPendingInvititations(org), null, options); } } } diff --git a/Octokit.Reactive/Clients/ObservableOrganizationOutsideCollaboratorsClient.cs b/Octokit.Reactive/Clients/ObservableOrganizationOutsideCollaboratorsClient.cs index 94d5f409dc..f4cc5bfabf 100644 --- a/Octokit.Reactive/Clients/ObservableOrganizationOutsideCollaboratorsClient.cs +++ b/Octokit.Reactive/Clients/ObservableOrganizationOutsideCollaboratorsClient.cs @@ -54,7 +54,7 @@ public IObservable GetAll(string org, ApiOptions options) Ensure.ArgumentNotNullOrEmptyString(org, nameof(org)); Ensure.ArgumentNotNull(options, nameof(options)); - return _connection.GetAndFlattenAllPages(ApiUrls.OutsideCollaborators(org), null, AcceptHeaders.OrganizationMembershipPreview, options); + return _connection.GetAndFlattenAllPages(ApiUrls.OutsideCollaborators(org), null, options); } /// @@ -92,7 +92,7 @@ public IObservable GetAll(string org, OrganizationMembersFilter filter, Ap Ensure.ArgumentNotNullOrEmptyString(org, nameof(org)); Ensure.ArgumentNotNull(options, nameof(options)); - return _connection.GetAndFlattenAllPages(ApiUrls.OutsideCollaborators(org, filter), null, AcceptHeaders.OrganizationMembershipPreview, options); + return _connection.GetAndFlattenAllPages(ApiUrls.OutsideCollaborators(org, filter), null, options); } /// diff --git a/Octokit.Reactive/Clients/ObservableProjectCardsClient.cs b/Octokit.Reactive/Clients/ObservableProjectCardsClient.cs index 424f1c7cc3..23a3441354 100644 --- a/Octokit.Reactive/Clients/ObservableProjectCardsClient.cs +++ b/Octokit.Reactive/Clients/ObservableProjectCardsClient.cs @@ -81,7 +81,7 @@ public IObservable GetAll(int columnId, ProjectCardRequest request, var url = ApiUrls.ProjectCards(columnId); - return _connection.GetAndFlattenAllPages(url, request.ToParametersDictionary(), AcceptHeaders.ProjectsApiPreview, options); + return _connection.GetAndFlattenAllPages(url, request.ToParametersDictionary(), options); } /// diff --git a/Octokit.Reactive/Clients/ObservableProjectColumnsClient.cs b/Octokit.Reactive/Clients/ObservableProjectColumnsClient.cs index c52d51fa1f..36afe03909 100644 --- a/Octokit.Reactive/Clients/ObservableProjectColumnsClient.cs +++ b/Octokit.Reactive/Clients/ObservableProjectColumnsClient.cs @@ -44,7 +44,7 @@ public IObservable GetAll(int projectId, ApiOptions options) var url = ApiUrls.ProjectColumns(projectId); - return _connection.GetAndFlattenAllPages(url, new Dictionary(), AcceptHeaders.ProjectsApiPreview, options); + return _connection.GetAndFlattenAllPages(url, new Dictionary(), options); } /// diff --git a/Octokit.Reactive/Clients/ObservableProjectsClient.cs b/Octokit.Reactive/Clients/ObservableProjectsClient.cs index 76d7195400..3694f90c90 100644 --- a/Octokit.Reactive/Clients/ObservableProjectsClient.cs +++ b/Octokit.Reactive/Clients/ObservableProjectsClient.cs @@ -57,7 +57,7 @@ public IObservable GetAllForRepository(string owner, string name, ApiOp var url = ApiUrls.RepositoryProjects(owner, name); - return _connection.GetAndFlattenAllPages(url, new Dictionary(), AcceptHeaders.ProjectsApiPreview, options); + return _connection.GetAndFlattenAllPages(url, new Dictionary(), options); } /// @@ -93,7 +93,7 @@ public IObservable GetAllForRepository(string owner, string name, Proje var url = ApiUrls.RepositoryProjects(owner, name); - return _connection.GetAndFlattenAllPages(url, request.ToParametersDictionary(), AcceptHeaders.ProjectsApiPreview, options); + return _connection.GetAndFlattenAllPages(url, request.ToParametersDictionary(), options); } /// @@ -122,7 +122,7 @@ public IObservable GetAllForRepository(long repositoryId, ApiOptions op var url = ApiUrls.RepositoryProjects(repositoryId); - return _connection.GetAndFlattenAllPages(url, new Dictionary(), AcceptHeaders.ProjectsApiPreview, options); + return _connection.GetAndFlattenAllPages(url, new Dictionary(), options); } /// @@ -154,7 +154,7 @@ public IObservable GetAllForRepository(long repositoryId, ProjectReques var url = ApiUrls.RepositoryProjects(repositoryId); - return _connection.GetAndFlattenAllPages(url, request.ToParametersDictionary(), AcceptHeaders.ProjectsApiPreview, options); + return _connection.GetAndFlattenAllPages(url, request.ToParametersDictionary(), options); } /// @@ -184,7 +184,7 @@ public IObservable GetAllForOrganization(string organization, ApiOption var url = ApiUrls.OrganizationProjects(organization); - return _connection.GetAndFlattenAllPages(url, new Dictionary(), AcceptHeaders.ProjectsApiPreview, options); + return _connection.GetAndFlattenAllPages(url, new Dictionary(), options); } /// @@ -217,7 +217,7 @@ public IObservable GetAllForOrganization(string organization, ProjectRe var url = ApiUrls.OrganizationProjects(organization); - return _connection.GetAndFlattenAllPages(url, request.ToParametersDictionary(), AcceptHeaders.ProjectsApiPreview, options); + return _connection.GetAndFlattenAllPages(url, request.ToParametersDictionary(), options); } /// diff --git a/Octokit.Reactive/Clients/ObservablePullRequestReviewCommentReactionsClient.cs b/Octokit.Reactive/Clients/ObservablePullRequestReviewCommentReactionsClient.cs index 967aaa1d2d..858d793757 100644 --- a/Octokit.Reactive/Clients/ObservablePullRequestReviewCommentReactionsClient.cs +++ b/Octokit.Reactive/Clients/ObservablePullRequestReviewCommentReactionsClient.cs @@ -42,7 +42,7 @@ public IObservable GetAll(string owner, string name, int number, ApiOp Ensure.ArgumentNotNullOrEmptyString(name, nameof(name)); Ensure.ArgumentNotNull(options, nameof(options)); - return _connection.GetAndFlattenAllPages(ApiUrls.PullRequestReviewCommentReactions(owner, name, number), null, AcceptHeaders.ReactionsPreview, options); + return _connection.GetAndFlattenAllPages(ApiUrls.PullRequestReviewCommentReactions(owner, name, number), null, options); } /// @@ -67,7 +67,7 @@ public IObservable GetAll(long repositoryId, int number, ApiOptions op { Ensure.ArgumentNotNull(options, nameof(options)); - return _connection.GetAndFlattenAllPages(ApiUrls.PullRequestReviewCommentReactions(repositoryId, number), null, AcceptHeaders.ReactionsPreview, options); + return _connection.GetAndFlattenAllPages(ApiUrls.PullRequestReviewCommentReactions(repositoryId, number), null, options); } /// diff --git a/Octokit.Reactive/Clients/ObservablePullRequestReviewCommentsClient.cs b/Octokit.Reactive/Clients/ObservablePullRequestReviewCommentsClient.cs index 877ff4c111..3c36d15770 100644 --- a/Octokit.Reactive/Clients/ObservablePullRequestReviewCommentsClient.cs +++ b/Octokit.Reactive/Clients/ObservablePullRequestReviewCommentsClient.cs @@ -64,7 +64,7 @@ public IObservable GetAll(string owner, string name, i Ensure.ArgumentNotNullOrEmptyString(name, nameof(name)); Ensure.ArgumentNotNull(options, nameof(options)); - return _connection.GetAndFlattenAllPages(ApiUrls.PullRequestReviewComments(owner, name, number), null, AcceptHeaders.ReactionsPreview, options); + return _connection.GetAndFlattenAllPages(ApiUrls.PullRequestReviewComments(owner, name, number), null, options); } /// @@ -178,8 +178,7 @@ public IObservable GetAllForRepository(string owner, s Ensure.ArgumentNotNull(request, nameof(request)); Ensure.ArgumentNotNull(options, nameof(options)); - return _connection.GetAndFlattenAllPages(ApiUrls.PullRequestReviewCommentsRepository(owner, name), request.ToParametersDictionary(), AcceptHeaders.ReactionsPreview, - options); + return _connection.GetAndFlattenAllPages(ApiUrls.PullRequestReviewCommentsRepository(owner, name), request.ToParametersDictionary(), options); } /// @@ -194,11 +193,7 @@ public IObservable GetAllForRepository(long repository Ensure.ArgumentNotNull(request, nameof(request)); Ensure.ArgumentNotNull(options, nameof(options)); - return _connection.GetAndFlattenAllPages( - ApiUrls.PullRequestReviewCommentsRepository(repositoryId), - request.ToParametersDictionary(), - AcceptHeaders.ReactionsPreview, - options); + return _connection.GetAndFlattenAllPages(ApiUrls.PullRequestReviewCommentsRepository(repositoryId), request.ToParametersDictionary(), options); } /// diff --git a/Octokit.Reactive/Clients/ObservablePullRequestsClient.cs b/Octokit.Reactive/Clients/ObservablePullRequestsClient.cs index 96a1bd3fa2..9fbafba8ba 100644 --- a/Octokit.Reactive/Clients/ObservablePullRequestsClient.cs +++ b/Octokit.Reactive/Clients/ObservablePullRequestsClient.cs @@ -111,7 +111,7 @@ public IObservable GetAllForRepository(string owner, string name, A Ensure.ArgumentNotNullOrEmptyString(name, nameof(name)); Ensure.ArgumentNotNull(options, nameof(options)); - return _connection.GetAndFlattenAllPages(ApiUrls.PullRequests(owner, name), null, AcceptHeaders.DraftPullRequestApiPreview, options); + return _connection.GetAndFlattenAllPages(ApiUrls.PullRequests(owner, name), null, options); } /// @@ -126,7 +126,7 @@ public IObservable GetAllForRepository(long repositoryId, ApiOption { Ensure.ArgumentNotNull(options, nameof(options)); - return _connection.GetAndFlattenAllPages(ApiUrls.PullRequests(repositoryId), null, AcceptHeaders.DraftPullRequestApiPreview, options); + return _connection.GetAndFlattenAllPages(ApiUrls.PullRequests(repositoryId), null, options); } /// @@ -180,7 +180,7 @@ public IObservable GetAllForRepository(string owner, string name, P Ensure.ArgumentNotNull(options, nameof(options)); return _connection.GetAndFlattenAllPages(ApiUrls.PullRequests(owner, name), - request.ToParametersDictionary(), AcceptHeaders.DraftPullRequestApiPreview, options); + request.ToParametersDictionary(), options); } /// @@ -198,7 +198,7 @@ public IObservable GetAllForRepository(long repositoryId, PullReque Ensure.ArgumentNotNull(options, nameof(options)); return _connection.GetAndFlattenAllPages(ApiUrls.PullRequests(repositoryId), - request.ToParametersDictionary(), AcceptHeaders.DraftPullRequestApiPreview, options); + request.ToParametersDictionary(), options); } /// diff --git a/Octokit.Reactive/Clients/ObservableRepositoryCommentsClient.cs b/Octokit.Reactive/Clients/ObservableRepositoryCommentsClient.cs index 7258bfac6c..7e97fb51b2 100644 --- a/Octokit.Reactive/Clients/ObservableRepositoryCommentsClient.cs +++ b/Octokit.Reactive/Clients/ObservableRepositoryCommentsClient.cs @@ -87,7 +87,7 @@ public IObservable GetAllForRepository(string owner, string name, Ensure.ArgumentNotNullOrEmptyString(name, nameof(name)); Ensure.ArgumentNotNull(options, nameof(options)); - return _connection.GetAndFlattenAllPages(ApiUrls.CommitComments(owner, name), null, AcceptHeaders.ReactionsPreview, options); + return _connection.GetAndFlattenAllPages(ApiUrls.CommitComments(owner, name), null, options); } /// @@ -100,7 +100,7 @@ public IObservable GetAllForRepository(long repositoryId, ApiOpti { Ensure.ArgumentNotNull(options, nameof(options)); - return _connection.GetAndFlattenAllPages(ApiUrls.CommitComments(repositoryId), null, AcceptHeaders.ReactionsPreview, options); + return _connection.GetAndFlattenAllPages(ApiUrls.CommitComments(repositoryId), null, options); } /// @@ -147,7 +147,7 @@ public IObservable GetAllForCommit(string owner, string name, str Ensure.ArgumentNotNullOrEmptyString(sha, nameof(sha)); Ensure.ArgumentNotNull(options, nameof(options)); - return _connection.GetAndFlattenAllPages(ApiUrls.CommitComments(owner, name, sha), null, AcceptHeaders.ReactionsPreview, options); + return _connection.GetAndFlattenAllPages(ApiUrls.CommitComments(owner, name, sha), null, options); } /// @@ -162,7 +162,7 @@ public IObservable GetAllForCommit(long repositoryId, string sha, Ensure.ArgumentNotNullOrEmptyString(sha, nameof(sha)); Ensure.ArgumentNotNull(options, nameof(options)); - return _connection.GetAndFlattenAllPages(ApiUrls.CommitComments(repositoryId, sha), null, AcceptHeaders.ReactionsPreview, options); + return _connection.GetAndFlattenAllPages(ApiUrls.CommitComments(repositoryId, sha), null, options); } /// diff --git a/Octokit.Reactive/Clients/ObservableStarredClient.cs b/Octokit.Reactive/Clients/ObservableStarredClient.cs index f1c60e932b..ab2e1781b3 100644 --- a/Octokit.Reactive/Clients/ObservableStarredClient.cs +++ b/Octokit.Reactive/Clients/ObservableStarredClient.cs @@ -113,7 +113,7 @@ public IObservable GetAllStargazersWithTimestamps(string owner, string Ensure.ArgumentNotNullOrEmptyString(name, nameof(name)); Ensure.ArgumentNotNull(options, nameof(options)); - return _connection.GetAndFlattenAllPages(ApiUrls.Stargazers(owner, name), null, AcceptHeaders.StarCreationTimestamps, options); + return _connection.GetAndFlattenAllPages(ApiUrls.Stargazers(owner, name), null, options); } /// @@ -126,7 +126,7 @@ public IObservable GetAllStargazersWithTimestamps(long repositoryId, A { Ensure.ArgumentNotNull(options, nameof(options)); - return _connection.GetAndFlattenAllPages(ApiUrls.Stargazers(repositoryId), null, AcceptHeaders.StarCreationTimestamps, options); + return _connection.GetAndFlattenAllPages(ApiUrls.Stargazers(repositoryId), null, options); } /// @@ -166,7 +166,7 @@ public IObservable GetAllForCurrentWithTimestamps(ApiOptions opt { Ensure.ArgumentNotNull(options, nameof(options)); - return _connection.GetAndFlattenAllPages(ApiUrls.Starred(), null, AcceptHeaders.StarCreationTimestamps, options); + return _connection.GetAndFlattenAllPages(ApiUrls.Starred(), null, options); } /// @@ -220,7 +220,7 @@ public IObservable GetAllForCurrentWithTimestamps(StarredRequest Ensure.ArgumentNotNull(request, nameof(request)); Ensure.ArgumentNotNull(options, nameof(options)); - return _connection.GetAndFlattenAllPages(ApiUrls.Starred(), request.ToParametersDictionary(), AcceptHeaders.StarCreationTimestamps, options); + return _connection.GetAndFlattenAllPages(ApiUrls.Starred(), request.ToParametersDictionary(), options); } /// @@ -272,7 +272,7 @@ public IObservable GetAllForUserWithTimestamps(string user, ApiO Ensure.ArgumentNotNullOrEmptyString(user, nameof(user)); Ensure.ArgumentNotNull(options, nameof(options)); - return _connection.GetAndFlattenAllPages(ApiUrls.StarredByUser(user), null, AcceptHeaders.StarCreationTimestamps, options); + return _connection.GetAndFlattenAllPages(ApiUrls.StarredByUser(user), null, options); } /// @@ -334,7 +334,7 @@ public IObservable GetAllForUserWithTimestamps(string user, Star Ensure.ArgumentNotNull(request, nameof(request)); Ensure.ArgumentNotNull(options, nameof(options)); - return _connection.GetAndFlattenAllPages(ApiUrls.StarredByUser(user), request.ToParametersDictionary(), AcceptHeaders.StarCreationTimestamps, options); + return _connection.GetAndFlattenAllPages(ApiUrls.StarredByUser(user), request.ToParametersDictionary(), options); } /// diff --git a/Octokit.Reactive/Clients/ObservableTeamsClient.cs b/Octokit.Reactive/Clients/ObservableTeamsClient.cs index 4630bbdc99..9fa0d3f7ba 100644 --- a/Octokit.Reactive/Clients/ObservableTeamsClient.cs +++ b/Octokit.Reactive/Clients/ObservableTeamsClient.cs @@ -389,7 +389,7 @@ public IObservable GetAllPendingInvitations(in Ensure.ArgumentNotNull(id, nameof(id)); Ensure.ArgumentNotNull(options, nameof(options)); - return _connection.GetAndFlattenAllPages(ApiUrls.TeamPendingInvitations(id), null, AcceptHeaders.OrganizationMembershipPreview, options); + return _connection.GetAndFlattenAllPages(ApiUrls.TeamPendingInvitations(id), null, options); } } } diff --git a/Octokit.Tests.Integration/Helper.cs b/Octokit.Tests.Integration/Helper.cs index 2bc13c74bf..bea408208f 100644 --- a/Octokit.Tests.Integration/Helper.cs +++ b/Octokit.Tests.Integration/Helper.cs @@ -336,7 +336,7 @@ public static void DeleteInvitations(IConnection connection, List invite { foreach (var invitee in invitees) { - connection.Delete(new Uri($"orgs/{Organization}/memberships/{invitee}", UriKind.Relative), null, AcceptHeaders.OrganizationMembershipPreview).Wait(TimeSpan.FromSeconds(15)); + connection.Delete(new Uri($"orgs/{Organization}/memberships/{invitee}", UriKind.Relative), null).Wait(TimeSpan.FromSeconds(15)); } } catch { } diff --git a/Octokit.Tests/Clients/CheckRunsClientTests.cs b/Octokit.Tests/Clients/CheckRunsClientTests.cs index 8cffdd3328..dd9639c3af 100644 --- a/Octokit.Tests/Clients/CheckRunsClientTests.cs +++ b/Octokit.Tests/Clients/CheckRunsClientTests.cs @@ -31,8 +31,7 @@ public async Task RequestsCorrectUrl() connection.Received().Post( Arg.Is(u => u.ToString() == "repos/fake/repo/check-runs"), - newCheckRun, - "application/vnd.github.antiope-preview+json"); + newCheckRun); } [Fact] @@ -47,8 +46,7 @@ public async Task RequestsCorrectUrlWithRepositoryId() connection.Received().Post( Arg.Is(u => u.ToString() == "repositories/1/check-runs"), - newCheckRun, - "application/vnd.github.antiope-preview+json"); + newCheckRun); } [Fact] @@ -93,8 +91,7 @@ public async Task RequestsCorrectUrl() connection.Received().Patch( Arg.Is(u => u.ToString() == "repos/fake/repo/check-runs/1"), - update, - "application/vnd.github.antiope-preview+json"); + update); } [Fact] @@ -109,8 +106,7 @@ public async Task RequestsCorrectUrlWithRepositoryId() connection.Received().Patch( Arg.Is(u => u.ToString() == "repositories/1/check-runs/1"), - update, - "application/vnd.github.antiope-preview+json"); + update); } [Fact] @@ -152,7 +148,6 @@ public async Task RequestsCorrectUrl() connection.Received().GetAll( Arg.Is(u => u.ToString() == "repos/fake/repo/commits/ref/check-runs"), Args.EmptyDictionary, - "application/vnd.github.antiope-preview+json", Args.ApiOptions); } @@ -167,7 +162,6 @@ public async Task RequestsCorrectUrlWithRepositoryId() connection.Received().GetAll( Arg.Is(u => u.ToString() == "repositories/1/commits/ref/check-runs"), Args.EmptyDictionary, - "application/vnd.github.antiope-preview+json", Args.ApiOptions); } @@ -188,7 +182,6 @@ public async Task RequestsCorrectUrlWithRequest() && x["check_name"] == "build" && x["status"] == "in_progress" && x["filter"] == "latest"), - "application/vnd.github.antiope-preview+json", Args.ApiOptions); } @@ -209,7 +202,6 @@ public async Task RequestsCorrectUrlWithRequestWithRepositoryId() && x["check_name"] == "build" && x["status"] == "in_progress" && x["filter"] == "latest"), - "application/vnd.github.antiope-preview+json", Args.ApiOptions); } @@ -231,7 +223,6 @@ public async Task RequestsCorrectUrlWithRequestWithApiOptions() && x["check_name"] == "build" && x["status"] == "in_progress" && x["filter"] == "latest"), - "application/vnd.github.antiope-preview+json", options); } @@ -253,7 +244,6 @@ public async Task RequestsCorrectUrlWithRequestWithApiOptionsWithRepositoryId() && x["check_name"] == "build" && x["status"] == "in_progress" && x["filter"] == "latest"), - "application/vnd.github.antiope-preview+json", options); } @@ -331,7 +321,6 @@ public async Task RequestsCorrectUrl() connection.Received().GetAll( Arg.Is(u => u.ToString() == "repos/fake/repo/check-suites/1/check-runs"), Args.EmptyDictionary, - "application/vnd.github.antiope-preview+json", Args.ApiOptions); } @@ -346,7 +335,6 @@ public async Task RequestsCorrectUrlWithRepositoryId() connection.Received().GetAll( Arg.Is(u => u.ToString() == "repositories/1/check-suites/1/check-runs"), Args.EmptyDictionary, - "application/vnd.github.antiope-preview+json", Args.ApiOptions); } @@ -367,7 +355,6 @@ public async Task RequestsCorrectUrlWithRequest() && x["check_name"] == "build" && x["status"] == "in_progress" && x["filter"] == "latest"), - "application/vnd.github.antiope-preview+json", Args.ApiOptions); } @@ -388,7 +375,6 @@ public async Task RequestsCorrectUrlWithRequestWithRepositoryId() && x["check_name"] == "build" && x["status"] == "in_progress" && x["filter"] == "latest"), - "application/vnd.github.antiope-preview+json", Args.ApiOptions); } @@ -410,7 +396,6 @@ public async Task RequestsCorrectUrlWithRequestWithApiOptions() && x["check_name"] == "build" && x["status"] == "in_progress" && x["filter"] == "latest"), - "application/vnd.github.antiope-preview+json", options); } @@ -432,7 +417,6 @@ public async Task RequestsCorrectUrlWithRequestWithApiOptionsWithRepositoryId() && x["check_name"] == "build" && x["status"] == "in_progress" && x["filter"] == "latest"), - "application/vnd.github.antiope-preview+json", options); } @@ -493,8 +477,7 @@ public async Task RequestsCorrectUrl() connection.Received().Get( Arg.Is(u => u.ToString() == "repos/fake/repo/check-runs/1"), - null, - "application/vnd.github.antiope-preview+json"); + null); } [Fact] @@ -507,8 +490,7 @@ public async Task RequestsCorrectUrlWithRepositoryId() connection.Received().Get( Arg.Is(u => u.ToString() == "repositories/1/check-runs/1"), - null, - "application/vnd.github.antiope-preview+json"); + null); } [Fact] @@ -545,7 +527,6 @@ public async Task RequestsCorrectUrl() connection.Received().GetAll( Arg.Is(u => u.ToString() == "repos/fake/repo/check-runs/1/annotations"), null, - "application/vnd.github.antiope-preview+json", Args.ApiOptions); } @@ -560,7 +541,6 @@ public async Task RequestsCorrectUrlWithRepositoryId() connection.Received().GetAll( Arg.Is(u => u.ToString() == "repositories/1/check-runs/1/annotations"), null, - "application/vnd.github.antiope-preview+json", Args.ApiOptions); } @@ -577,7 +557,6 @@ public async Task RequestsCorrectUrlWithApiOptions() connection.Received().GetAll( Arg.Is(u => u.ToString() == "repos/fake/repo/check-runs/1/annotations"), null, - "application/vnd.github.antiope-preview+json", options); } @@ -594,7 +573,6 @@ public async Task RequestsCorrectUrlWithApiOptionsWithRepositoryId() connection.Received().GetAll( Arg.Is(u => u.ToString() == "repositories/1/check-runs/1/annotations"), null, - "application/vnd.github.antiope-preview+json", options); } diff --git a/Octokit.Tests/Clients/CheckSuitesClientTests.cs b/Octokit.Tests/Clients/CheckSuitesClientTests.cs index 194c70fcc7..6e6821fecb 100644 --- a/Octokit.Tests/Clients/CheckSuitesClientTests.cs +++ b/Octokit.Tests/Clients/CheckSuitesClientTests.cs @@ -84,7 +84,6 @@ public async Task RequestsCorrectUrl() connection.Received().GetAll( Arg.Is(u => u.ToString() == "repos/fake/repo/commits/ref/check-suites"), Args.EmptyDictionary, - "application/vnd.github.antiope-preview+json", Args.ApiOptions); } @@ -99,7 +98,6 @@ public async Task RequestsCorrectUrlWithRepositoryId() connection.Received().GetAll( Arg.Is(u => u.ToString() == "repositories/1/commits/ref/check-suites"), Args.EmptyDictionary, - "application/vnd.github.antiope-preview+json", Args.ApiOptions); } @@ -122,7 +120,6 @@ public async Task RequestsCorrectUrlWithRequest() Arg.Is>(x => x["app_id"] == "123" && x["check_name"] == "build"), - "application/vnd.github.antiope-preview+json", Args.ApiOptions); } @@ -145,7 +142,6 @@ public async Task RequestsCorrectUrlWithRequestWithRepositoryId() Arg.Is>(x => x["app_id"] == "123" && x["check_name"] == "build"), - "application/vnd.github.antiope-preview+json", Args.ApiOptions); } @@ -284,8 +280,7 @@ public async Task RequestsCorrectUrl() connection.Received().Post( Arg.Is(u => u.ToString() == "repos/fake/repo/check-suites"), - newCheckSuite, - "application/vnd.github.antiope-preview+json"); + newCheckSuite); } [Fact] @@ -300,8 +295,7 @@ public async Task RequestsCorrectUrlWithRepositoryId() connection.Received().Post( Arg.Is(u => u.ToString() == "repositories/1/check-suites"), - newCheckSuite, - "application/vnd.github.antiope-preview+json"); + newCheckSuite); } [Fact] diff --git a/Octokit/Clients/AssigneesClient.cs b/Octokit/Clients/AssigneesClient.cs index 4938d934c2..42a7f64e8c 100644 --- a/Octokit/Clients/AssigneesClient.cs +++ b/Octokit/Clients/AssigneesClient.cs @@ -58,7 +58,7 @@ public Task> GetAllForRepository(string owner, string name, var endpoint = ApiUrls.Assignees(owner, name); - return ApiConnection.GetAll(endpoint, null, AcceptHeaders.StableVersion, options); + return ApiConnection.GetAll(endpoint, null, options); } /// @@ -73,7 +73,7 @@ public Task> GetAllForRepository(long repositoryId, ApiOptio var endpoint = ApiUrls.Assignees(repositoryId); - return ApiConnection.GetAll(endpoint, null, AcceptHeaders.StableVersion, options); + return ApiConnection.GetAll(endpoint, null, options); } /// diff --git a/Octokit/Clients/AuthorizationsClient.cs b/Octokit/Clients/AuthorizationsClient.cs index d1be719133..03dedf3d1e 100644 --- a/Octokit/Clients/AuthorizationsClient.cs +++ b/Octokit/Clients/AuthorizationsClient.cs @@ -147,7 +147,7 @@ public Task Create( }; var endpoint = ApiUrls.Authorizations(); - return ApiConnection.Post(endpoint, requestData, null, null, twoFactorAuthenticationCode); + return ApiConnection.Post(endpoint, requestData, null, twoFactorAuthenticationCode); } /// @@ -357,7 +357,7 @@ public Task CheckApplicationAuthentication(string clie }; var endpoint = ApiUrls.ApplicationAuthorization(clientId); - return ApiConnection.Post(endpoint, requestData, AcceptHeaders.OAuthApplicationsPreview); + return ApiConnection.Post(endpoint, requestData); } /// @@ -382,7 +382,7 @@ public Task ResetApplicationAuthentication(string clie }; var endpoint = ApiUrls.ApplicationAuthorization(clientId); - return ApiConnection.Patch(endpoint, requestData, AcceptHeaders.OAuthApplicationsPreview); + return ApiConnection.Patch(endpoint, requestData); } /// @@ -407,7 +407,7 @@ public Task RevokeApplicationAuthentication(string clientId, string accessToken) }; var endpoint = ApiUrls.ApplicationAuthorization(clientId); - return ApiConnection.Delete(endpoint, requestData, AcceptHeaders.OAuthApplicationsPreview); + return ApiConnection.Delete(endpoint, requestData); } /// diff --git a/Octokit/Clients/CheckRunsClient.cs b/Octokit/Clients/CheckRunsClient.cs index dcefe018a9..6b8de0ed94 100644 --- a/Octokit/Clients/CheckRunsClient.cs +++ b/Octokit/Clients/CheckRunsClient.cs @@ -30,7 +30,6 @@ public CheckRunsClient(IApiConnection apiConnection) : base(apiConnection) /// The owner of the repository /// The name of the repository /// Details of the Check Run to create - [Preview("antiope")] [ManualRoute("POST", "/repos/{owner}/{repo}/check-runs")] public Task Create(string owner, string name, NewCheckRun newCheckRun) { @@ -38,7 +37,7 @@ public Task Create(string owner, string name, NewCheckRun newCheckRun) Ensure.ArgumentNotNullOrEmptyString(name, nameof(name)); Ensure.ArgumentNotNull(newCheckRun, nameof(newCheckRun)); - return ApiConnection.Post(ApiUrls.CheckRuns(owner, name), newCheckRun, AcceptHeaders.ChecksApiPreview); + return ApiConnection.Post(ApiUrls.CheckRuns(owner, name), newCheckRun); } /// @@ -49,13 +48,12 @@ public Task Create(string owner, string name, NewCheckRun newCheckRun) /// /// The Id of the repository /// Details of the Check Run to create - [Preview("antiope")] [ManualRoute("POST", "/repositories/{id}/check-runs")] public Task Create(long repositoryId, NewCheckRun newCheckRun) { Ensure.ArgumentNotNull(newCheckRun, nameof(newCheckRun)); - return ApiConnection.Post(ApiUrls.CheckRuns(repositoryId), newCheckRun, AcceptHeaders.ChecksApiPreview); + return ApiConnection.Post(ApiUrls.CheckRuns(repositoryId), newCheckRun); } /// @@ -68,7 +66,6 @@ public Task Create(long repositoryId, NewCheckRun newCheckRun) /// The name of the repository /// The Id of the check run /// The updates to the check run - [Preview("antiope")] [ManualRoute("PATCH", "/repos/{owner}/{repo}/check-runs/{check_run_id}")] public Task Update(string owner, string name, long checkRunId, CheckRunUpdate checkRunUpdate) { @@ -76,7 +73,7 @@ public Task Update(string owner, string name, long checkRunId, CheckRu Ensure.ArgumentNotNullOrEmptyString(name, nameof(name)); Ensure.ArgumentNotNull(checkRunUpdate, nameof(checkRunUpdate)); - return ApiConnection.Patch(ApiUrls.CheckRun(owner, name, checkRunId), checkRunUpdate, AcceptHeaders.ChecksApiPreview); + return ApiConnection.Patch(ApiUrls.CheckRun(owner, name, checkRunId), checkRunUpdate); } /// @@ -88,13 +85,12 @@ public Task Update(string owner, string name, long checkRunId, CheckRu /// The Id of the repository /// The Id of the check run /// The updates to the check run - [Preview("antiope")] [ManualRoute("PATCH", "/repositories/{id}/check-runs/{check_run_id}")] public Task Update(long repositoryId, long checkRunId, CheckRunUpdate checkRunUpdate) { Ensure.ArgumentNotNull(checkRunUpdate, nameof(checkRunUpdate)); - return ApiConnection.Patch(ApiUrls.CheckRun(repositoryId, checkRunId), checkRunUpdate, AcceptHeaders.ChecksApiPreview); + return ApiConnection.Patch(ApiUrls.CheckRun(repositoryId, checkRunId), checkRunUpdate); } /// @@ -182,7 +178,6 @@ public Task GetAllForReference(long repositoryId, string refe /// The commit reference (can be a SHA, branch name, or a tag name) /// Details to filter the request, such as by check name /// Options to change the API response - [Preview("antiope")] [ManualRoute("GET", "/repos/{owner}/{repo}/commits/{commit_sha}/check-runs")] public async Task GetAllForReference(string owner, string name, string reference, CheckRunRequest checkRunRequest, ApiOptions options) { @@ -192,7 +187,7 @@ public async Task GetAllForReference(string owner, string nam Ensure.ArgumentNotNull(checkRunRequest, nameof(checkRunRequest)); Ensure.ArgumentNotNull(options, nameof(options)); - var results = await ApiConnection.GetAll(ApiUrls.CheckRunsForReference(owner, name, reference), checkRunRequest.ToParametersDictionary(), AcceptHeaders.ChecksApiPreview, options).ConfigureAwait(false); + var results = await ApiConnection.GetAll(ApiUrls.CheckRunsForReference(owner, name, reference), checkRunRequest.ToParametersDictionary(), options).ConfigureAwait(false); return new CheckRunsResponse( results.Count > 0 ? results.Max(x => x.TotalCount) : 0, @@ -209,7 +204,6 @@ public async Task GetAllForReference(string owner, string nam /// The commit reference (can be a SHA, branch name, or a tag name) /// Details to filter the request, such as by check name /// Options to change the API response - [Preview("antiope")] [ManualRoute("GET", "/repositories/{id}/commits/{commit_sha}/check-runs")] public async Task GetAllForReference(long repositoryId, string reference, CheckRunRequest checkRunRequest, ApiOptions options) { @@ -217,7 +211,7 @@ public async Task GetAllForReference(long repositoryId, strin Ensure.ArgumentNotNull(checkRunRequest, nameof(checkRunRequest)); Ensure.ArgumentNotNull(options, nameof(options)); - var results = await ApiConnection.GetAll(ApiUrls.CheckRunsForReference(repositoryId, reference), checkRunRequest.ToParametersDictionary(), AcceptHeaders.ChecksApiPreview, options).ConfigureAwait(false); + var results = await ApiConnection.GetAll(ApiUrls.CheckRunsForReference(repositoryId, reference), checkRunRequest.ToParametersDictionary(), options).ConfigureAwait(false); return new CheckRunsResponse( results.Count > 0 ? results.Max(x => x.TotalCount) : 0, @@ -304,7 +298,6 @@ public Task GetAllForCheckSuite(long repositoryId, long check /// The Id of the check suite /// Details to filter the request, such as by check name /// Options to change the API response - [Preview("antiope")] [ManualRoute("GET", "/repos/{owner}/{repo}/check-suite/{check_suite_id}/check-runs")] public async Task GetAllForCheckSuite(string owner, string name, long checkSuiteId, CheckRunRequest checkRunRequest, ApiOptions options) { @@ -313,7 +306,7 @@ public async Task GetAllForCheckSuite(string owner, string na Ensure.ArgumentNotNull(checkRunRequest, nameof(checkRunRequest)); Ensure.ArgumentNotNull(options, nameof(options)); - var results = await ApiConnection.GetAll(ApiUrls.CheckRunsForCheckSuite(owner, name, checkSuiteId), checkRunRequest.ToParametersDictionary(), AcceptHeaders.ChecksApiPreview, options).ConfigureAwait(false); + var results = await ApiConnection.GetAll(ApiUrls.CheckRunsForCheckSuite(owner, name, checkSuiteId), checkRunRequest.ToParametersDictionary(), options).ConfigureAwait(false); return new CheckRunsResponse( results.Count > 0 ? results.Max(x => x.TotalCount) : 0, @@ -330,14 +323,13 @@ public async Task GetAllForCheckSuite(string owner, string na /// The Id of the check suite /// Details to filter the request, such as by check name /// Options to change the API response - [Preview("antiope")] [ManualRoute("GET", "/repositories/{id}/check-suites/{check_suite_id}/check-runs")] public async Task GetAllForCheckSuite(long repositoryId, long checkSuiteId, CheckRunRequest checkRunRequest, ApiOptions options) { Ensure.ArgumentNotNull(checkRunRequest, nameof(checkRunRequest)); Ensure.ArgumentNotNull(options, nameof(options)); - var results = await ApiConnection.GetAll(ApiUrls.CheckRunsForCheckSuite(repositoryId, checkSuiteId), checkRunRequest.ToParametersDictionary(), AcceptHeaders.ChecksApiPreview, options).ConfigureAwait(false); + var results = await ApiConnection.GetAll(ApiUrls.CheckRunsForCheckSuite(repositoryId, checkSuiteId), checkRunRequest.ToParametersDictionary(), options).ConfigureAwait(false); return new CheckRunsResponse( results.Count > 0 ? results.Max(x => x.TotalCount) : 0, @@ -353,14 +345,13 @@ public async Task GetAllForCheckSuite(long repositoryId, long /// The owner of the repository /// The name of the repository /// The Id of the check run - [Preview("antiope")] [ManualRoute("GET", "/repos/{owner}/{repo}/check-runs/{check_run_id}")] public Task Get(string owner, string name, long checkRunId) { Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner)); Ensure.ArgumentNotNullOrEmptyString(name, nameof(name)); - return ApiConnection.Get(ApiUrls.CheckRun(owner, name, checkRunId), null, AcceptHeaders.ChecksApiPreview); + return ApiConnection.Get(ApiUrls.CheckRun(owner, name, checkRunId), null); } /// @@ -371,11 +362,10 @@ public Task Get(string owner, string name, long checkRunId) /// /// The Id of the repository /// The Id of the check run - [Preview("antiope")] [ManualRoute("GET", "/repositories/{id}/check-runs/{check_run_id}")] public Task Get(long repositoryId, long checkRunId) { - return ApiConnection.Get(ApiUrls.CheckRun(repositoryId, checkRunId), null, AcceptHeaders.ChecksApiPreview); + return ApiConnection.Get(ApiUrls.CheckRun(repositoryId, checkRunId), null); } /// @@ -421,7 +411,6 @@ public Task> GetAllAnnotations(long repository /// The name of the repository /// The Id of the check run /// Options to change the API response - [Preview("antiope")] [ManualRoute("GET", "/repos/{owner}/{repo}/check-runs/{check_run_id}/annotations")] public Task> GetAllAnnotations(string owner, string name, long checkRunId, ApiOptions options) { @@ -429,7 +418,7 @@ public Task> GetAllAnnotations(string owner, s Ensure.ArgumentNotNullOrEmptyString(name, nameof(name)); Ensure.ArgumentNotNull(options, nameof(options)); - return ApiConnection.GetAll(ApiUrls.CheckRunAnnotations(owner, name, checkRunId), null, AcceptHeaders.ChecksApiPreview, options); + return ApiConnection.GetAll(ApiUrls.CheckRunAnnotations(owner, name, checkRunId), null, options); } /// @@ -441,13 +430,12 @@ public Task> GetAllAnnotations(string owner, s /// The Id of the repository /// The Id of the check run /// Options to change the API response - [Preview("antiope")] [ManualRoute("GET", "/repositories/{id}/check-runs/{check_run_id}/annotations")] public Task> GetAllAnnotations(long repositoryId, long checkRunId, ApiOptions options) { Ensure.ArgumentNotNull(options, nameof(options)); - return ApiConnection.GetAll(ApiUrls.CheckRunAnnotations(repositoryId, checkRunId), null, AcceptHeaders.ChecksApiPreview, options); + return ApiConnection.GetAll(ApiUrls.CheckRunAnnotations(repositoryId, checkRunId), null, options); } } } diff --git a/Octokit/Clients/CheckSuitesClient.cs b/Octokit/Clients/CheckSuitesClient.cs index 6102d0cb98..f3472b2e6f 100644 --- a/Octokit/Clients/CheckSuitesClient.cs +++ b/Octokit/Clients/CheckSuitesClient.cs @@ -30,14 +30,13 @@ public CheckSuitesClient(IApiConnection apiConnection) : base(apiConnection) /// The owner of the repository /// The name of the repository /// The Id of the check suite - [Preview("antiope")] [ManualRoute("GET", "/repos/{owner}/{repo}/check-suites/{id}")] public Task Get(string owner, string name, long checkSuiteId) { Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner)); Ensure.ArgumentNotNullOrEmptyString(name, nameof(name)); - return ApiConnection.Get(ApiUrls.CheckSuite(owner, name, checkSuiteId), null, AcceptHeaders.ChecksApiPreview); + return ApiConnection.Get(ApiUrls.CheckSuite(owner, name, checkSuiteId), null); } /// @@ -48,11 +47,10 @@ public Task Get(string owner, string name, long checkSuiteId) /// /// The Id of the repository /// The Id of the check suite - [Preview("antiope")] [ManualRoute("GET", "/repositories/{id}/check-suites/{check_suite_id}")] public Task Get(long repositoryId, long checkSuiteId) { - return ApiConnection.Get(ApiUrls.CheckSuite(repositoryId, checkSuiteId), null, AcceptHeaders.ChecksApiPreview); + return ApiConnection.Get(ApiUrls.CheckSuite(repositoryId, checkSuiteId), null); } /// @@ -140,7 +138,6 @@ public Task GetAllForReference(long repositoryId, string re /// The reference (SHA, branch name or tag name) to list check suites for /// Details to filter the request, such as by App Id or Check Name /// Options to change the API response - [Preview("antiope")] [ManualRoute("GET", "/repos/{owner}/{repo}/commits/{ref}/check-suites")] public async Task GetAllForReference(string owner, string name, string reference, CheckSuiteRequest request, ApiOptions options) { @@ -150,7 +147,7 @@ public async Task GetAllForReference(string owner, string n Ensure.ArgumentNotNull(request, nameof(request)); Ensure.ArgumentNotNull(options, nameof(options)); - var results = await ApiConnection.GetAll(ApiUrls.CheckSuitesForReference(owner, name, reference), request.ToParametersDictionary(), AcceptHeaders.ChecksApiPreview, options).ConfigureAwait(false); + var results = await ApiConnection.GetAll(ApiUrls.CheckSuitesForReference(owner, name, reference), request.ToParametersDictionary(), options).ConfigureAwait(false); return new CheckSuitesResponse( results.Count > 0 ? results.Max(x => x.TotalCount) : 0, @@ -167,7 +164,6 @@ public async Task GetAllForReference(string owner, string n /// The reference (SHA, branch name or tag name) to list check suites for /// Details to filter the request, such as by App Id or Check Name /// Options to change the API response - [Preview("antiope")] [ManualRoute("GET", "/repositories/{id}/commits/{ref}/check-suites")] public async Task GetAllForReference(long repositoryId, string reference, CheckSuiteRequest request, ApiOptions options) { @@ -175,7 +171,7 @@ public async Task GetAllForReference(long repositoryId, str Ensure.ArgumentNotNull(options, nameof(options)); Ensure.ArgumentNotNullOrEmptyString(reference, nameof(reference)); - var results = await ApiConnection.GetAll(ApiUrls.CheckSuitesForReference(repositoryId, reference), request.ToParametersDictionary(), AcceptHeaders.ChecksApiPreview, options).ConfigureAwait(false); + var results = await ApiConnection.GetAll(ApiUrls.CheckSuitesForReference(repositoryId, reference), request.ToParametersDictionary(), options).ConfigureAwait(false); return new CheckSuitesResponse( results.Count > 0 ? results.Max(x => x.TotalCount) : 0, @@ -191,7 +187,6 @@ public async Task GetAllForReference(long repositoryId, str /// The owner of the repository /// The name of the repository /// The check suite preferences - [Preview("antiope")] [ManualRoute("PATCH", "/repos/{owner}/{repo}/check-suites/preferences")] public Task UpdatePreferences(string owner, string name, CheckSuitePreferences preferences) { @@ -199,7 +194,7 @@ public Task UpdatePreferences(string owner, strin Ensure.ArgumentNotNullOrEmptyString(name, nameof(name)); Ensure.ArgumentNotNull(preferences, nameof(preferences)); - return ApiConnection.Patch(ApiUrls.CheckSuitePreferences(owner, name), preferences, AcceptHeaders.ChecksApiPreview); + return ApiConnection.Patch(ApiUrls.CheckSuitePreferences(owner, name), preferences); } /// @@ -210,13 +205,12 @@ public Task UpdatePreferences(string owner, strin /// /// The Id of the repository /// The check suite preferences - [Preview("antiope")] [ManualRoute("GET", "/repositories/{id}/check-suites/preferences")] public Task UpdatePreferences(long repositoryId, CheckSuitePreferences preferences) { Ensure.ArgumentNotNull(preferences, nameof(preferences)); - return ApiConnection.Patch(ApiUrls.CheckSuitePreferences(repositoryId), preferences, AcceptHeaders.ChecksApiPreview); + return ApiConnection.Patch(ApiUrls.CheckSuitePreferences(repositoryId), preferences); } /// @@ -228,7 +222,6 @@ public Task UpdatePreferences(long repositoryId, /// The owner of the repository /// The name of the repository /// Details of the Check Suite to create - [Preview("antiope")] [ManualRoute("POST", "/repos/{owner}/{repo}/check-suites")] public Task Create(string owner, string name, NewCheckSuite newCheckSuite) { @@ -236,7 +229,7 @@ public Task Create(string owner, string name, NewCheckSuite newCheck Ensure.ArgumentNotNullOrEmptyString(name, nameof(name)); Ensure.ArgumentNotNull(newCheckSuite, nameof(newCheckSuite)); - return ApiConnection.Post(ApiUrls.CheckSuites(owner, name), newCheckSuite, AcceptHeaders.ChecksApiPreview); + return ApiConnection.Post(ApiUrls.CheckSuites(owner, name), newCheckSuite); } /// @@ -247,13 +240,12 @@ public Task Create(string owner, string name, NewCheckSuite newCheck /// /// The Id of the repository /// Details of the Check Suite to create - [Preview("antiope")] [ManualRoute("GET", "/repositories/{id}/check-suites")] public Task Create(long repositoryId, NewCheckSuite newCheckSuite) { Ensure.ArgumentNotNull(newCheckSuite, nameof(newCheckSuite)); - return ApiConnection.Post(ApiUrls.CheckSuites(repositoryId), newCheckSuite, AcceptHeaders.ChecksApiPreview); + return ApiConnection.Post(ApiUrls.CheckSuites(repositoryId), newCheckSuite); } /// @@ -265,14 +257,13 @@ public Task Create(long repositoryId, NewCheckSuite newCheckSuite) /// The owner of the repository /// The name of the repository /// The Id of the check suite - [Preview("antiope")] [ManualRoute("GET", "/repos/{owner}/{repo}/check-suites/{2}/rerequest")] public async Task Rerequest(string owner, string name, long checkSuiteId) { Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner)); Ensure.ArgumentNotNullOrEmptyString(name, nameof(name)); - var httpStatusCode = await Connection.Post(ApiUrls.CheckSuiteRerequest(owner, name, checkSuiteId), null, AcceptHeaders.ChecksApiPreview).ConfigureAwait(false); + var httpStatusCode = await Connection.Post(ApiUrls.CheckSuiteRerequest(owner, name, checkSuiteId)).ConfigureAwait(false); if (httpStatusCode != HttpStatusCode.Created) { @@ -290,11 +281,10 @@ public async Task Rerequest(string owner, string name, long checkSuiteId) /// /// The Id of the repository /// The Id of the check suite - [Preview("antiope")] [ManualRoute("GET", "/repositories/{id}/check-suites/{2}/rerequest")] public async Task Rerequest(long repositoryId, long checkSuiteId) { - var httpStatusCode = await Connection.Post(ApiUrls.CheckSuiteRerequest(repositoryId, checkSuiteId), null, AcceptHeaders.ChecksApiPreview).ConfigureAwait(false); + var httpStatusCode = await Connection.Post(ApiUrls.CheckSuiteRerequest(repositoryId, checkSuiteId)).ConfigureAwait(false); if (httpStatusCode != HttpStatusCode.Created) { diff --git a/Octokit/Clients/CommitCommentReactionsClient.cs b/Octokit/Clients/CommitCommentReactionsClient.cs index 320c35cdb9..1c05c0f3ce 100644 --- a/Octokit/Clients/CommitCommentReactionsClient.cs +++ b/Octokit/Clients/CommitCommentReactionsClient.cs @@ -25,7 +25,6 @@ public CommitCommentReactionsClient(IApiConnection apiConnection) /// The comment id /// The reaction to create /// - [Preview("squirrel-girl")] [ManualRoute("POST", "/repos/{owner}/{repo}/comments/{comment_id}/reactions")] public Task Create(string owner, string name, int number, NewReaction reaction) { @@ -33,7 +32,7 @@ public Task Create(string owner, string name, int number, NewReaction Ensure.ArgumentNotNullOrEmptyString(name, nameof(name)); Ensure.ArgumentNotNull(reaction, nameof(reaction)); - return ApiConnection.Post(ApiUrls.CommitCommentReactions(owner, name, number), reaction, AcceptHeaders.ReactionsPreview); + return ApiConnection.Post(ApiUrls.CommitCommentReactions(owner, name, number), reaction); } /// @@ -44,13 +43,12 @@ public Task Create(string owner, string name, int number, NewReaction /// The comment id /// The reaction to create /// - [Preview("squirrel-girl")] [ManualRoute("POST", "/repositories/{id}/comments/{comment_id}/reactions")] public Task Create(long repositoryId, int number, NewReaction reaction) { Ensure.ArgumentNotNull(reaction, nameof(reaction)); - return ApiConnection.Post(ApiUrls.CommitCommentReactions(repositoryId, number), reaction, AcceptHeaders.ReactionsPreview); + return ApiConnection.Post(ApiUrls.CommitCommentReactions(repositoryId, number), reaction); } /// @@ -76,7 +74,6 @@ public Task> GetAll(string owner, string name, int numbe /// The comment id /// Options for changing the API response /// - [Preview("squirrel-girl")] [ManualRoute("GET", "/repos/{owner}/{repo}/comments/{comment_id}/reactions")] public Task> GetAll(string owner, string name, int number, ApiOptions options) { @@ -84,7 +81,7 @@ public Task> GetAll(string owner, string name, int numbe Ensure.ArgumentNotNullOrEmptyString(name, nameof(name)); Ensure.ArgumentNotNull(options, nameof(options)); - return ApiConnection.GetAll(ApiUrls.CommitCommentReactions(owner, name, number), null, AcceptHeaders.ReactionsPreview, options); + return ApiConnection.GetAll(ApiUrls.CommitCommentReactions(owner, name, number), null, options); } /// @@ -108,13 +105,12 @@ public Task> GetAll(long repositoryId, int number) /// The comment id /// Options for changing the API response /// - [Preview("squirrel-girl")] [ManualRoute("GET", "/repositories/{id}/comments/{comment_id}/reactions")] public Task> GetAll(long repositoryId, int number, ApiOptions options) { Ensure.ArgumentNotNull(options, nameof(options)); - return ApiConnection.GetAll(ApiUrls.CommitCommentReactions(repositoryId, number), null, AcceptHeaders.ReactionsPreview, options); + return ApiConnection.GetAll(ApiUrls.CommitCommentReactions(repositoryId, number), null, options); } /// diff --git a/Octokit/Clients/DeploymentStatusClient.cs b/Octokit/Clients/DeploymentStatusClient.cs index 63eee18cc1..00d78514a2 100644 --- a/Octokit/Clients/DeploymentStatusClient.cs +++ b/Octokit/Clients/DeploymentStatusClient.cs @@ -62,8 +62,6 @@ public Task> GetAll(long repositoryId, int deplo /// The name of the repository. /// The id of the deployment. /// Options for changing the API response - [Preview("ant-man")] - [Preview("flash")] [ManualRoute("GET", "/repos/{owner}/{repo}/deployments/{deployment_id}/statuses")] public Task> GetAll(string owner, string name, int deploymentId, ApiOptions options) { @@ -71,10 +69,7 @@ public Task> GetAll(string owner, string name, i Ensure.ArgumentNotNullOrEmptyString(name, nameof(name)); Ensure.ArgumentNotNull(options, nameof(options)); - return ApiConnection.GetAll(ApiUrls.DeploymentStatuses(owner, name, deploymentId), - null, - AcceptHeaders.Concat(AcceptHeaders.DeploymentApiPreview, AcceptHeaders.DeploymentStatusesPreview), - options); + return ApiConnection.GetAll(ApiUrls.DeploymentStatuses(owner, name, deploymentId), null, options); } /// @@ -87,17 +82,12 @@ public Task> GetAll(string owner, string name, i /// The Id of the repository. /// The id of the deployment. /// Options for changing the API response - [Preview("ant-man")] - [Preview("flash")] [ManualRoute("GET", "/repositories/{id}/deployments/{deployment_id}/statuses")] public Task> GetAll(long repositoryId, int deploymentId, ApiOptions options) { Ensure.ArgumentNotNull(options, nameof(options)); - return ApiConnection.GetAll(ApiUrls.DeploymentStatuses(repositoryId, deploymentId), - null, - AcceptHeaders.Concat(AcceptHeaders.DeploymentApiPreview, AcceptHeaders.DeploymentStatusesPreview), - options); + return ApiConnection.GetAll(ApiUrls.DeploymentStatuses(repositoryId, deploymentId), null, options); } /// @@ -111,8 +101,6 @@ public Task> GetAll(long repositoryId, int deplo /// The name of the repository. /// The id of the deployment. /// The new deployment status to create. - [Preview("ant-man")] - [Preview("flash")] [ManualRoute("POST", "/repos/{owner}/{repo}/deployments/{deployment_id}/statuses")] public Task Create(string owner, string name, int deploymentId, NewDeploymentStatus newDeploymentStatus) { @@ -120,9 +108,7 @@ public Task Create(string owner, string name, int deploymentId Ensure.ArgumentNotNullOrEmptyString(name, nameof(name)); Ensure.ArgumentNotNull(newDeploymentStatus, nameof(newDeploymentStatus)); - return ApiConnection.Post(ApiUrls.DeploymentStatuses(owner, name, deploymentId), - newDeploymentStatus, - AcceptHeaders.Concat(AcceptHeaders.DeploymentApiPreview, AcceptHeaders.DeploymentStatusesPreview)); + return ApiConnection.Post(ApiUrls.DeploymentStatuses(owner, name, deploymentId), newDeploymentStatus); } /// @@ -135,16 +121,12 @@ public Task Create(string owner, string name, int deploymentId /// The Id of the repository. /// The id of the deployment. /// The new deployment status to create. - [Preview("ant-man")] - [Preview("flash")] [ManualRoute("POST", "/repositories/{id}/deployments/{deployment_id}/statuses")] public Task Create(long repositoryId, int deploymentId, NewDeploymentStatus newDeploymentStatus) { Ensure.ArgumentNotNull(newDeploymentStatus, nameof(newDeploymentStatus)); - return ApiConnection.Post(ApiUrls.DeploymentStatuses(repositoryId, deploymentId), - newDeploymentStatus, - AcceptHeaders.Concat(AcceptHeaders.DeploymentApiPreview, AcceptHeaders.DeploymentStatusesPreview)); + return ApiConnection.Post(ApiUrls.DeploymentStatuses(repositoryId, deploymentId), newDeploymentStatus); } } } diff --git a/Octokit/Clients/DeploymentsClient.cs b/Octokit/Clients/DeploymentsClient.cs index b7eb95c177..3947911e13 100644 --- a/Octokit/Clients/DeploymentsClient.cs +++ b/Octokit/Clients/DeploymentsClient.cs @@ -64,7 +64,6 @@ public Task> GetAll(long repositoryId) /// The owner of the repository /// The name of the repository /// Options for changing the API response - [Preview("ant-man")] [ManualRoute("GET", "/repos/{owner}/{repo}/deployments")] public Task> GetAll(string owner, string name, ApiOptions options) { @@ -72,10 +71,7 @@ public Task> GetAll(string owner, string name, ApiOpti Ensure.ArgumentNotNullOrEmptyString(name, nameof(name)); Ensure.ArgumentNotNull(options, nameof(options)); - return ApiConnection.GetAll(ApiUrls.Deployments(owner, name), - null, - AcceptHeaders.DeploymentApiPreview, - options); + return ApiConnection.GetAll(ApiUrls.Deployments(owner, name), null, options); } /// @@ -105,7 +101,6 @@ public Task> GetAll(long repositoryId, ApiOptions opti /// The owner of the repository /// The name of the repository /// A instance describing the new deployment to create - [Preview("ant-man")] [ManualRoute("POST", "/repos/{owner}/{repo}/deployments")] public Task Create(string owner, string name, NewDeployment newDeployment) { @@ -113,9 +108,7 @@ public Task Create(string owner, string name, NewDeployment newDeplo Ensure.ArgumentNotNullOrEmptyString(name, nameof(name)); Ensure.ArgumentNotNull(newDeployment, nameof(newDeployment)); - return ApiConnection.Post(ApiUrls.Deployments(owner, name), - newDeployment, - AcceptHeaders.DeploymentApiPreview); + return ApiConnection.Post(ApiUrls.Deployments(owner, name), newDeployment); } /// diff --git a/Octokit/Clients/Enterprise/EnterprisePreReceiveEnvironmentsClient.cs b/Octokit/Clients/Enterprise/EnterprisePreReceiveEnvironmentsClient.cs index 013f2fe23f..35df6f4a63 100644 --- a/Octokit/Clients/Enterprise/EnterprisePreReceiveEnvironmentsClient.cs +++ b/Octokit/Clients/Enterprise/EnterprisePreReceiveEnvironmentsClient.cs @@ -44,7 +44,7 @@ public Task> GetAll() public Task> GetAll(ApiOptions options) { var endpoint = ApiUrls.AdminPreReceiveEnvironments(); - return ApiConnection.GetAll(endpoint, null, AcceptHeaders.PreReceiveEnvironmentsPreview, options); + return ApiConnection.GetAll(endpoint, null, options); } /// @@ -60,7 +60,7 @@ public Task> GetAll(ApiOptions options) public Task Get(long environmentId) { var endpoint = ApiUrls.AdminPreReceiveEnvironments(environmentId); - return ApiConnection.Get(endpoint, null, AcceptHeaders.PreReceiveEnvironmentsPreview); + return ApiConnection.Get(endpoint, null); } /// @@ -77,7 +77,7 @@ public Task Create(NewPreReceiveEnvironment newPreReceive Ensure.ArgumentNotNull(newPreReceiveEnvironment, nameof(newPreReceiveEnvironment)); var endpoint = ApiUrls.AdminPreReceiveEnvironments(); - return ApiConnection.Post(endpoint, newPreReceiveEnvironment, AcceptHeaders.PreReceiveEnvironmentsPreview); + return ApiConnection.Post(endpoint, newPreReceiveEnvironment); } /// @@ -96,7 +96,7 @@ public Task Edit(long environmentId, UpdatePreReceiveEnvi Ensure.ArgumentNotNull(updatePreReceiveEnvironment, nameof(updatePreReceiveEnvironment)); var endpoint = ApiUrls.AdminPreReceiveEnvironments(environmentId); - return ApiConnection.Patch(endpoint, updatePreReceiveEnvironment, AcceptHeaders.PreReceiveEnvironmentsPreview); + return ApiConnection.Patch(endpoint, updatePreReceiveEnvironment); } /// @@ -112,7 +112,7 @@ public Task Edit(long environmentId, UpdatePreReceiveEnvi public Task Delete(long environmentId) { var endpoint = ApiUrls.AdminPreReceiveEnvironments(environmentId); - return ApiConnection.Delete(endpoint, new object(), AcceptHeaders.PreReceiveEnvironmentsPreview); + return ApiConnection.Delete(endpoint, new object()); } /// @@ -128,7 +128,7 @@ public Task Delete(long environmentId) public Task DownloadStatus(long environmentId) { var endpoint = ApiUrls.AdminPreReceiveEnvironmentDownloadStatus(environmentId); - return ApiConnection.Get(endpoint, null, AcceptHeaders.PreReceiveEnvironmentsPreview); + return ApiConnection.Get(endpoint, null); } /// @@ -145,7 +145,7 @@ public Task DownloadStatus(long environmentId) public Task TriggerDownload(long environmentId) { var endpoint = ApiUrls.AdminPreReceiveEnvironmentDownload(environmentId); - return ApiConnection.Post(endpoint, new object(), AcceptHeaders.PreReceiveEnvironmentsPreview); + return ApiConnection.Post(endpoint, new object()); } } } diff --git a/Octokit/Clients/GitHubAppInstallationsClient.cs b/Octokit/Clients/GitHubAppInstallationsClient.cs index 7bba1e472a..4ef440f01b 100644 --- a/Octokit/Clients/GitHubAppInstallationsClient.cs +++ b/Octokit/Clients/GitHubAppInstallationsClient.cs @@ -30,13 +30,12 @@ public Task GetAllRepositoriesForCurrent() /// /// Options for changing the API response /// https://developer.github.com/v3/apps/installations/#list-repositories - [Preview("machine-man")] [ManualRoute("GET", "/installation/repositories")] public async Task GetAllRepositoriesForCurrent(ApiOptions options) { Ensure.ArgumentNotNull(options, nameof(options)); - var results = await ApiConnection.GetAll(ApiUrls.InstallationRepositories(), null, AcceptHeaders.GitHubAppsPreview, options).ConfigureAwait(false); + var results = await ApiConnection.GetAll(ApiUrls.InstallationRepositories(), null, options).ConfigureAwait(false); return new RepositoriesResponse( results.Count > 0 ? results.Max(x => x.TotalCount) : 0, @@ -60,13 +59,12 @@ public Task GetAllRepositoriesForCurrentUser(long installa /// The Id of the installation /// Options for changing the API response /// https://developer.github.com/v3/apps/installations/#list-repositories-accessible-to-the-user-for-an-installation - [Preview("machine-man")] [ManualRoute("GET", "/user/installation/{id}/repositories")] public async Task GetAllRepositoriesForCurrentUser(long installationId, ApiOptions options) { Ensure.ArgumentNotNull(options, nameof(options)); - var results = await ApiConnection.GetAll(ApiUrls.UserInstallationRepositories(installationId), null, AcceptHeaders.GitHubAppsPreview, options).ConfigureAwait(false); + var results = await ApiConnection.GetAll(ApiUrls.UserInstallationRepositories(installationId), null, options).ConfigureAwait(false); return new RepositoriesResponse( results.Count > 0 ? results.Max(x => x.TotalCount) : 0, diff --git a/Octokit/Clients/GitHubAppsClient.cs b/Octokit/Clients/GitHubAppsClient.cs index 7a0f08c875..e9ee0ad2dd 100644 --- a/Octokit/Clients/GitHubAppsClient.cs +++ b/Octokit/Clients/GitHubAppsClient.cs @@ -33,24 +33,22 @@ public GitHubAppsClient(IApiConnection apiConnection) : base(apiConnection) /// /// https://developer.github.com/v3/apps/#get-a-single-github-app /// The URL-friendly name of your GitHub App. You can find this on the settings page for your GitHub App. - [Preview("machine-man")] [ManualRoute("GET", "/apps/{slug}")] public Task Get(string slug) { Ensure.ArgumentNotNullOrEmptyString(slug, nameof(slug)); - return ApiConnection.Get(ApiUrls.App(slug), null, AcceptHeaders.GitHubAppsPreview); + return ApiConnection.Get(ApiUrls.App(slug), null); } /// /// Returns the GitHub App associated with the authentication credentials used (requires GitHubApp auth). /// /// https://developer.github.com/v3/apps/#get-the-authenticated-github-app - [Preview("machine-man")] [ManualRoute("GET", "/app")] public Task GetCurrent() { - return ApiConnection.Get(ApiUrls.App(), null, AcceptHeaders.GitHubAppsPreview); + return ApiConnection.Get(ApiUrls.App(), null); } /// @@ -68,13 +66,12 @@ public Task> GetAllInstallationsForCurrent() /// /// Options for changing the API response /// https://developer.github.com/v3/apps/#find-installations - [Preview("machine-man")] [ManualRoute("GET", "/app/installations")] public Task> GetAllInstallationsForCurrent(ApiOptions options) { Ensure.ArgumentNotNull(options, nameof(options)); - return ApiConnection.GetAll(ApiUrls.Installations(), null, AcceptHeaders.GitHubAppsPreview, options); + return ApiConnection.GetAll(ApiUrls.Installations(), null, options); } /// @@ -93,22 +90,20 @@ public Task GetInstallation(long installationId) /// /// https://developer.github.com/v3/apps/#get-a-single-installation /// The Id of the GitHub App Installation - [Preview("machine-man")] [ManualRoute("GET", "/app/installations/{installation_id}")] public Task GetInstallationForCurrent(long installationId) { - return ApiConnection.Get(ApiUrls.Installation(installationId), null, AcceptHeaders.GitHubAppsPreview); + return ApiConnection.Get(ApiUrls.Installation(installationId), null); } /// /// List installations for the currently authenticated user (requires GitHubApp User-To-Server Auth). /// /// https://developer.github.com/v3/apps/#list-installations-for-user - [Preview("machine-man")] [ManualRoute("GET", "/user/installations")] public async Task GetAllInstallationsForCurrentUser() { - var results = await ApiConnection.GetAll(ApiUrls.UserInstallations(), null, AcceptHeaders.GitHubAppsPreview).ConfigureAwait(false); + var results = await ApiConnection.GetAll(ApiUrls.UserInstallations()).ConfigureAwait(false); return new InstallationsResponse( results.Count > 0 ? results.Max(x => x.TotalCount) : 0, @@ -119,13 +114,12 @@ public async Task GetAllInstallationsForCurrentUser() /// List installations for the currently authenticated user (requires GitHubApp User-To-Server Auth). /// /// https://developer.github.com/v3/apps/#list-installations-for-user - [Preview("machine-man")] [ManualRoute("GET", "/user/installations")] public async Task GetAllInstallationsForCurrentUser(ApiOptions options) { Ensure.ArgumentNotNull(options, nameof(options)); - var results = await ApiConnection.GetAll(ApiUrls.UserInstallations(), null, AcceptHeaders.GitHubAppsPreview, options).ConfigureAwait(false); + var results = await ApiConnection.GetAll(ApiUrls.UserInstallations(), null, options).ConfigureAwait(false); return new InstallationsResponse( results.Count > 0 ? results.Max(x => x.TotalCount) : 0, @@ -141,11 +135,10 @@ public async Task GetAllInstallationsForCurrentUser(ApiOp /// https://developer.github.com/v3/apps/available-endpoints/ /// /// The Id of the GitHub App Installation - [Preview("machine-man")] [ManualRoute("GET", "/app/installations/{installation_id}/access_tokens")] public Task CreateInstallationToken(long installationId) { - return ApiConnection.Post(ApiUrls.AccessTokens(installationId), string.Empty, AcceptHeaders.GitHubAppsPreview); + return ApiConnection.Post(ApiUrls.AccessTokens(installationId), string.Empty); } /// @@ -153,13 +146,12 @@ public Task CreateInstallationToken(long installationId) /// /// https://developer.github.com/v3/apps/#find-organization-installation /// The name of the organization - [Preview("machine-man")] [ManualRoute("GET", "/orgs/{org}/installation")] public Task GetOrganizationInstallationForCurrent(string organization) { Ensure.ArgumentNotNullOrEmptyString(organization, nameof(organization)); - return ApiConnection.Get(ApiUrls.OrganizationInstallation(organization), null, AcceptHeaders.GitHubAppsPreview); + return ApiConnection.Get(ApiUrls.OrganizationInstallation(organization), null); } /// @@ -168,14 +160,13 @@ public Task GetOrganizationInstallationForCurrent(string organizat /// https://developer.github.com/v3/apps/#find-repository-installation /// The owner of the repo /// The name of the repo - [Preview("machine-man")] [ManualRoute("GET", "/repos/{owner}/{repo}/installation")] public Task GetRepositoryInstallationForCurrent(string owner, string repo) { Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner)); Ensure.ArgumentNotNullOrEmptyString(repo, nameof(repo)); - return ApiConnection.Get(ApiUrls.RepoInstallation(owner, repo), null, AcceptHeaders.GitHubAppsPreview); + return ApiConnection.Get(ApiUrls.RepoInstallation(owner, repo), null); } /// @@ -183,11 +174,10 @@ public Task GetRepositoryInstallationForCurrent(string owner, stri /// /// https://developer.github.com/v3/apps/#find-repository-installation /// The Id of the repository - [Preview("machine-man")] [ManualRoute("GET", "/repositories/{id}/installation")] public Task GetRepositoryInstallationForCurrent(long repositoryId) { - return ApiConnection.Get(ApiUrls.RepoInstallation(repositoryId), null, AcceptHeaders.GitHubAppsPreview); + return ApiConnection.Get(ApiUrls.RepoInstallation(repositoryId), null); } /// @@ -195,13 +185,12 @@ public Task GetRepositoryInstallationForCurrent(long repositoryId) /// /// https://developer.github.com/v3/apps/#find-user-installation /// The name of the user - [Preview("machine-man")] [ManualRoute("GET", "/users/{username}/installation")] public Task GetUserInstallationForCurrent(string user) { Ensure.ArgumentNotNullOrEmptyString(user, nameof(user)); - return ApiConnection.Get(ApiUrls.UserInstallation(user), null, AcceptHeaders.GitHubAppsPreview); + return ApiConnection.Get(ApiUrls.UserInstallation(user), null); } } } diff --git a/Octokit/Clients/IssueCommentReactionsClient.cs b/Octokit/Clients/IssueCommentReactionsClient.cs index da889c8fdf..707272bf3f 100644 --- a/Octokit/Clients/IssueCommentReactionsClient.cs +++ b/Octokit/Clients/IssueCommentReactionsClient.cs @@ -24,7 +24,6 @@ public IssueCommentReactionsClient(IApiConnection apiConnection) /// The name of the repository /// The comment id /// The reaction to create - [Preview("squirrel-girl")] [ManualRoute("POST", "/repos/{owner}/{repo}/issues/comments/{number}/reactions")] public Task Create(string owner, string name, int number, NewReaction reaction) { @@ -32,7 +31,7 @@ public Task Create(string owner, string name, int number, NewReaction Ensure.ArgumentNotNullOrEmptyString(name, nameof(name)); Ensure.ArgumentNotNull(reaction, nameof(reaction)); - return ApiConnection.Post(ApiUrls.IssueCommentReactions(owner, name, number), reaction, AcceptHeaders.ReactionsPreview); + return ApiConnection.Post(ApiUrls.IssueCommentReactions(owner, name, number), reaction); } /// @@ -42,13 +41,12 @@ public Task Create(string owner, string name, int number, NewReaction /// The Id of the repository /// The comment id /// The reaction to create - [Preview("squirrel-girl")] [ManualRoute("POST", "/repositories/{0}/issues/comments/{number}/reactions")] public Task Create(long repositoryId, int number, NewReaction reaction) { Ensure.ArgumentNotNull(reaction, nameof(reaction)); - return ApiConnection.Post(ApiUrls.IssueCommentReactions(repositoryId, number), reaction, AcceptHeaders.ReactionsPreview); + return ApiConnection.Post(ApiUrls.IssueCommentReactions(repositoryId, number), reaction); } /// @@ -72,7 +70,6 @@ public Task> GetAll(string owner, string name, int numbe /// The name of the repository /// The comment id /// Options for changing the API response - [Preview("squirrel-girl")] [ManualRoute("POST", "/repos/{owner}/{repo}/issues/comments/{number}/reactions")] public Task> GetAll(string owner, string name, int number, ApiOptions options) { @@ -80,7 +77,7 @@ public Task> GetAll(string owner, string name, int numbe Ensure.ArgumentNotNullOrEmptyString(name, nameof(name)); Ensure.ArgumentNotNull(options, nameof(options)); - return ApiConnection.GetAll(ApiUrls.IssueCommentReactions(owner, name, number), null, AcceptHeaders.ReactionsPreview, options); + return ApiConnection.GetAll(ApiUrls.IssueCommentReactions(owner, name, number), null, options); } /// @@ -102,13 +99,12 @@ public Task> GetAll(long repositoryId, int number) /// The Id of the repository /// The comment id /// Options for changing the API response - [Preview("squirrel-girl")] [ManualRoute("GET", "/repositories/{0}/issues/comments/{number}/reactions")] public Task> GetAll(long repositoryId, int number, ApiOptions options) { Ensure.ArgumentNotNull(options, nameof(options)); - return ApiConnection.GetAll(ApiUrls.IssueCommentReactions(repositoryId, number), null, AcceptHeaders.ReactionsPreview, options); + return ApiConnection.GetAll(ApiUrls.IssueCommentReactions(repositoryId, number), null, options); } /// diff --git a/Octokit/Clients/IssueCommentsClient.cs b/Octokit/Clients/IssueCommentsClient.cs index a91648c53e..39bfa0d963 100644 --- a/Octokit/Clients/IssueCommentsClient.cs +++ b/Octokit/Clients/IssueCommentsClient.cs @@ -26,14 +26,13 @@ public IssueCommentsClient(IApiConnection apiConnection) : base(apiConnection) /// The owner of the repository /// The name of the repository /// The issue comment id - [Preview("squirrel-girl")] [ManualRoute("GET", "/repos/{owner}/{repo}/issues/comments/{comment_id}")] public Task Get(string owner, string name, int id) { Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner)); Ensure.ArgumentNotNullOrEmptyString(name, nameof(name)); - return ApiConnection.Get(ApiUrls.IssueComment(owner, name, id), null, AcceptHeaders.ReactionsPreview); + return ApiConnection.Get(ApiUrls.IssueComment(owner, name, id), null); } /// @@ -42,11 +41,10 @@ public Task Get(string owner, string name, int id) /// http://developer.github.com/v3/issues/comments/#get-a-single-comment /// The Id of the repository /// The issue comment id - [Preview("squirrel-girl")] [ManualRoute("GET", "/repositories/{id}/issues/comments/{comment_id}")] public Task Get(long repositoryId, int id) { - return ApiConnection.Get(ApiUrls.IssueComment(repositoryId, id), null, AcceptHeaders.ReactionsPreview); + return ApiConnection.Get(ApiUrls.IssueComment(repositoryId, id), null); } /// @@ -145,7 +143,6 @@ public Task> GetAllForRepository(long repositoryId, /// The name of the repository /// The sorting parameters /// Options for changing the API response - [Preview("squirrel-girl")] [ManualRoute("GET", "/repos/{owner}/{repo}/issues/comments")] public Task> GetAllForRepository(string owner, string name, IssueCommentRequest request, ApiOptions options) { @@ -154,7 +151,7 @@ public Task> GetAllForRepository(string owner, strin Ensure.ArgumentNotNull(request, nameof(request)); Ensure.ArgumentNotNull(options, nameof(options)); - return ApiConnection.GetAll(ApiUrls.IssueComments(owner, name), request.ToParametersDictionary(), AcceptHeaders.ReactionsPreview, options); + return ApiConnection.GetAll(ApiUrls.IssueComments(owner, name), request.ToParametersDictionary(), options); } /// @@ -164,14 +161,13 @@ public Task> GetAllForRepository(string owner, strin /// The Id of the repository /// The sorting parameters /// Options for changing the API response - [Preview("squirrel-girl")] [ManualRoute("GET", "/repositories/{id}/issues/comments")] public Task> GetAllForRepository(long repositoryId, IssueCommentRequest request, ApiOptions options) { Ensure.ArgumentNotNull(request, nameof(request)); Ensure.ArgumentNotNull(options, nameof(options)); - return ApiConnection.GetAll(ApiUrls.IssueComments(repositoryId), request.ToParametersDictionary(), AcceptHeaders.ReactionsPreview, options); + return ApiConnection.GetAll(ApiUrls.IssueComments(repositoryId), request.ToParametersDictionary(), options); } /// @@ -277,7 +273,6 @@ public Task> GetAllForIssue(long repositoryId, int n /// The issue number /// The sorting parameters /// Options for changing the API response - [Preview("squirrel-girl")] [ManualRoute("GET", "/repos/{owner}/{repo}/issues/{number]/comments")] public Task> GetAllForIssue(string owner, string name, int number, IssueCommentRequest request, ApiOptions options) { @@ -286,7 +281,7 @@ public Task> GetAllForIssue(string owner, string nam Ensure.ArgumentNotNull(request, nameof(request)); Ensure.ArgumentNotNull(options, nameof(options)); - return ApiConnection.GetAll(ApiUrls.IssueComments(owner, name, number), request.ToParametersDictionary(), AcceptHeaders.ReactionsPreview, options); + return ApiConnection.GetAll(ApiUrls.IssueComments(owner, name, number), request.ToParametersDictionary(), options); } /// @@ -298,13 +293,12 @@ public Task> GetAllForIssue(string owner, string nam /// The sorting parameters /// Options for changing the API response [ManualRoute("GET", "/repositories/{id}/issues/{number}/comments")] - [Preview("squirrel-girl")] public Task> GetAllForIssue(long repositoryId, int number, IssueCommentRequest request, ApiOptions options) { Ensure.ArgumentNotNull(request, nameof(request)); Ensure.ArgumentNotNull(options, nameof(options)); - return ApiConnection.GetAll(ApiUrls.IssueComments(repositoryId, number), request.ToParametersDictionary(), AcceptHeaders.ReactionsPreview, options); + return ApiConnection.GetAll(ApiUrls.IssueComments(repositoryId, number), request.ToParametersDictionary(), options); } /// diff --git a/Octokit/Clients/IssueReactionsClient.cs b/Octokit/Clients/IssueReactionsClient.cs index c8d2a2adc6..65f812965d 100644 --- a/Octokit/Clients/IssueReactionsClient.cs +++ b/Octokit/Clients/IssueReactionsClient.cs @@ -37,7 +37,6 @@ public Task> GetAll(string owner, string name, int numbe /// The name of the repository /// The issue id /// Options for changing the API response - [Preview("squirrel-girl")] [ManualRoute("GET", "/repos/{owner}/{repo}/issues/{issue_number}/reactions")] public Task> GetAll(string owner, string name, int number, ApiOptions options) { @@ -45,7 +44,7 @@ public Task> GetAll(string owner, string name, int numbe Ensure.ArgumentNotNullOrEmptyString(name, nameof(name)); Ensure.ArgumentNotNull(options, nameof(options)); - return ApiConnection.GetAll(ApiUrls.IssueReactions(owner, name, number), null, AcceptHeaders.ReactionsPreview, options); + return ApiConnection.GetAll(ApiUrls.IssueReactions(owner, name, number), null, options); } /// @@ -67,13 +66,12 @@ public Task> GetAll(long repositoryId, int number) /// The Id of the repository /// The issue id /// Options for changing the API response - [Preview("squirrel-girl")] [ManualRoute("GET", "/repositories/{id}/issues/{number}/reactions")] public Task> GetAll(long repositoryId, int number, ApiOptions options) { Ensure.ArgumentNotNull(options, nameof(options)); - return ApiConnection.GetAll(ApiUrls.IssueReactions(repositoryId, number), null, AcceptHeaders.ReactionsPreview, options); + return ApiConnection.GetAll(ApiUrls.IssueReactions(repositoryId, number), null, options); } /// @@ -84,7 +82,6 @@ public Task> GetAll(long repositoryId, int number, ApiOp /// The name of the repository /// The issue id /// The reaction to create - [Preview("squirrel-girl")] [ManualRoute("POST", "/repos/{owner}/{repo}/issues/{issue_number}/reactions")] public Task Create(string owner, string name, int number, NewReaction reaction) { @@ -92,7 +89,7 @@ public Task Create(string owner, string name, int number, NewReaction Ensure.ArgumentNotNullOrEmptyString(name, nameof(name)); Ensure.ArgumentNotNull(reaction, nameof(reaction)); - return ApiConnection.Post(ApiUrls.IssueReactions(owner, name, number), reaction, AcceptHeaders.ReactionsPreview); + return ApiConnection.Post(ApiUrls.IssueReactions(owner, name, number), reaction); } /// @@ -102,13 +99,12 @@ public Task Create(string owner, string name, int number, NewReaction /// The Id of the repository /// The issue id /// The reaction to create - [Preview("squirrel-girl")] [ManualRoute("POST", "/repositories/{id}/issues/{number}/reactions")] public Task Create(long repositoryId, int number, NewReaction reaction) { Ensure.ArgumentNotNull(reaction, nameof(reaction)); - return ApiConnection.Post(ApiUrls.IssueReactions(repositoryId, number), reaction, AcceptHeaders.ReactionsPreview); + return ApiConnection.Post(ApiUrls.IssueReactions(repositoryId, number), reaction); } /// diff --git a/Octokit/Clients/IssueTimelineClient.cs b/Octokit/Clients/IssueTimelineClient.cs index 00bbb3766c..bc367aa177 100644 --- a/Octokit/Clients/IssueTimelineClient.cs +++ b/Octokit/Clients/IssueTimelineClient.cs @@ -43,8 +43,6 @@ public Task> GetAllForIssue(string owner, strin /// The name of the repository /// The issue number /// Options for changing the API repsonse - [Preview("mockingbird")] - [Preview("starfox")] [ManualRoute("GET", "/repos/{owner}/{repo}/issues/{issue_number}/timeline")] public Task> GetAllForIssue(string owner, string repo, int number, ApiOptions options) { @@ -52,10 +50,7 @@ public Task> GetAllForIssue(string owner, strin Ensure.ArgumentNotNullOrEmptyString(repo, nameof(repo)); Ensure.ArgumentNotNull(options, nameof(options)); - return ApiConnection.GetAll(ApiUrls.IssueTimeline(owner, repo, number), - null, - AcceptHeaders.Concat(AcceptHeaders.IssueTimelineApiPreview, AcceptHeaders.IssueEventsApiPreview), - options); + return ApiConnection.GetAll(ApiUrls.IssueTimeline(owner, repo, number), null, options); } /// @@ -81,17 +76,12 @@ public Task> GetAllForIssue(long repositoryId, /// The Id of the repository /// The issue number /// Options for changing the API response - [Preview("mockingbird")] - [Preview("starfox")] [ManualRoute("GET", "/repositories/{id}/issues/{number}/timeline")] public Task> GetAllForIssue(long repositoryId, int number, ApiOptions options) { Ensure.ArgumentNotNull(options, nameof(options)); - return ApiConnection.GetAll(ApiUrls.IssueTimeline(repositoryId, number), - null, - AcceptHeaders.Concat(AcceptHeaders.IssueTimelineApiPreview, AcceptHeaders.IssueEventsApiPreview), - options); + return ApiConnection.GetAll(ApiUrls.IssueTimeline(repositoryId, number), null, options); } } } diff --git a/Octokit/Clients/IssuesClient.cs b/Octokit/Clients/IssuesClient.cs index e5b1279329..06a0fbf30b 100644 --- a/Octokit/Clients/IssuesClient.cs +++ b/Octokit/Clients/IssuesClient.cs @@ -66,14 +66,13 @@ public IssuesClient(IApiConnection apiConnection) : base(apiConnection) /// The owner of the repository /// The name of the repository /// The issue number - [Preview("squirrel-girl")] [ManualRoute("GET", "/repos/{owner}/{repo}/issues/{issue_number}")] public Task Get(string owner, string name, int number) { Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner)); Ensure.ArgumentNotNullOrEmptyString(name, nameof(name)); - return ApiConnection.Get(ApiUrls.Issue(owner, name, number), null, AcceptHeaders.ReactionsPreview); + return ApiConnection.Get(ApiUrls.Issue(owner, name, number), null); } /// @@ -84,11 +83,10 @@ public Task Get(string owner, string name, int number) /// /// The Id of the repository /// The issue number - [Preview("squirrel-girl")] [ManualRoute("GET", "/repositories/{id}/issues/{number}")] public Task Get(long repositoryId, int number) { - return ApiConnection.Get(ApiUrls.Issue(repositoryId, number), null, AcceptHeaders.ReactionsPreview); + return ApiConnection.Get(ApiUrls.Issue(repositoryId, number), null); } /// @@ -147,14 +145,13 @@ public Task> GetAllForCurrent(IssueRequest request) /// /// Used to filter and sort the list of issues returned /// Options for changing the API response - [Preview("squirrel-girl")] [ManualRoute("GET", "/issues")] public Task> GetAllForCurrent(IssueRequest request, ApiOptions options) { Ensure.ArgumentNotNull(request, nameof(request)); Ensure.ArgumentNotNull(options, nameof(options)); - return ApiConnection.GetAll(ApiUrls.Issues(), request.ToParametersDictionary(), AcceptHeaders.ReactionsPreview, options); + return ApiConnection.GetAll(ApiUrls.Issues(), request.ToParametersDictionary(), options); } /// @@ -211,14 +208,13 @@ public Task> GetAllForOwnedAndMemberRepositories(IssueReque /// /// Used to filter and sort the list of issues returned /// Options for changing the API response - [Preview("squirrel-girl")] [ManualRoute("GET", "/user/issues")] public Task> GetAllForOwnedAndMemberRepositories(IssueRequest request, ApiOptions options) { Ensure.ArgumentNotNull(request, nameof(request)); Ensure.ArgumentNotNull(options, nameof(options)); - return ApiConnection.GetAll(ApiUrls.IssuesForOwnedAndMember(), request.ToParametersDictionary(), AcceptHeaders.ReactionsPreview, options); + return ApiConnection.GetAll(ApiUrls.IssuesForOwnedAndMember(), request.ToParametersDictionary(), options); } /// @@ -279,7 +275,6 @@ public Task> GetAllForOrganization(string organization, Iss /// The name of the organization /// Used to filter and sort the list of issues returned /// Options for changing the API response - [Preview("squirrel-girl")] [ManualRoute("GET", "/orgs/{org}/issues")] public Task> GetAllForOrganization(string organization, IssueRequest request, ApiOptions options) { @@ -287,7 +282,7 @@ public Task> GetAllForOrganization(string organization, Iss Ensure.ArgumentNotNull(request, nameof(request)); Ensure.ArgumentNotNull(options, nameof(options)); - return ApiConnection.GetAll(ApiUrls.Issues(organization), request.ToParametersDictionary(), AcceptHeaders.ReactionsPreview, options); + return ApiConnection.GetAll(ApiUrls.Issues(organization), request.ToParametersDictionary(), options); } /// @@ -400,7 +395,6 @@ public Task> GetAllForRepository(long repositoryId, Reposit /// The name of the repository /// Used to filter and sort the list of issues returned /// Options for changing the API response - [Preview("squirrel-girl")] [ManualRoute("GET", "/repos/{owner}/{repo}/issues")] public Task> GetAllForRepository(string owner, string name, RepositoryIssueRequest request, ApiOptions options) { @@ -409,7 +403,7 @@ public Task> GetAllForRepository(string owner, string name, Ensure.ArgumentNotNull(request, nameof(request)); Ensure.ArgumentNotNull(options, nameof(options)); - return ApiConnection.GetAll(ApiUrls.Issues(owner, name), request.ToParametersDictionary(), AcceptHeaders.ReactionsPreview, options); + return ApiConnection.GetAll(ApiUrls.Issues(owner, name), request.ToParametersDictionary(), options); } /// @@ -421,14 +415,13 @@ public Task> GetAllForRepository(string owner, string name, /// The Id of the repository /// Used to filter and sort the list of issues returned /// Options for changing the API response - [Preview("squirrel-girl")] [ManualRoute("GET", "/repositories/{id}/issues")] public Task> GetAllForRepository(long repositoryId, RepositoryIssueRequest request, ApiOptions options) { Ensure.ArgumentNotNull(request, nameof(request)); Ensure.ArgumentNotNull(options, nameof(options)); - return ApiConnection.GetAll(ApiUrls.Issues(repositoryId), request.ToParametersDictionary(), AcceptHeaders.ReactionsPreview, options); + return ApiConnection.GetAll(ApiUrls.Issues(repositoryId), request.ToParametersDictionary(), options); } /// diff --git a/Octokit/Clients/IssuesEventsClient.cs b/Octokit/Clients/IssuesEventsClient.cs index eb782471a2..57f8f1c88d 100644 --- a/Octokit/Clients/IssuesEventsClient.cs +++ b/Octokit/Clients/IssuesEventsClient.cs @@ -57,7 +57,6 @@ public Task> GetAllForIssue(long repositoryId, int num /// The name of the repository /// The issue number /// Options for changing the API response - [Preview("starfox")] [ManualRoute("GET", "/repos/{owner}/{repo}/issues/{issue_number}/events")] public Task> GetAllForIssue(string owner, string name, int number, ApiOptions options) { @@ -65,10 +64,7 @@ public Task> GetAllForIssue(string owner, string name, Ensure.ArgumentNotNullOrEmptyString(name, nameof(name)); Ensure.ArgumentNotNull(options, nameof(options)); - return ApiConnection.GetAll(ApiUrls.IssuesEvents(owner, name, number), - null, - AcceptHeaders.IssueEventsApiPreview, - options); + return ApiConnection.GetAll(ApiUrls.IssuesEvents(owner, name, number), null, options); } /// @@ -80,16 +76,12 @@ public Task> GetAllForIssue(string owner, string name, /// The Id of the repository /// The issue number /// Options for changing the API response - [Preview("starfox")] [ManualRoute("GET", "/repositories/{id}/issues/{number}/events")] public Task> GetAllForIssue(long repositoryId, int number, ApiOptions options) { Ensure.ArgumentNotNull(options, nameof(options)); - return ApiConnection.GetAll(ApiUrls.IssuesEvents(repositoryId, number), - null, - AcceptHeaders.IssueEventsApiPreview, - options); + return ApiConnection.GetAll(ApiUrls.IssuesEvents(repositoryId, number), null, options); } /// @@ -131,7 +123,6 @@ public Task> GetAllForRepository(long repositoryId) /// The owner of the repository /// The name of the repository /// Options for changing the API response - [Preview("starfox")] [ManualRoute("GET", "/repos/{owner}/{repo}/issues/events")] public Task> GetAllForRepository(string owner, string name, ApiOptions options) { @@ -139,10 +130,7 @@ public Task> GetAllForRepository(string owner, string Ensure.ArgumentNotNullOrEmptyString(name, nameof(name)); Ensure.ArgumentNotNull(options, nameof(options)); - return ApiConnection.GetAll(ApiUrls.IssuesEvents(owner, name), - null, - AcceptHeaders.IssueEventsApiPreview, - options); + return ApiConnection.GetAll(ApiUrls.IssuesEvents(owner, name), null, options); } /// @@ -153,16 +141,12 @@ public Task> GetAllForRepository(string owner, string /// /// The Id of the repository /// Options for changing the API response - [Preview("starfox")] [ManualRoute("GET", "/repositories/{id}/issues/events")] public Task> GetAllForRepository(long repositoryId, ApiOptions options) { Ensure.ArgumentNotNull(options, nameof(options)); - return ApiConnection.GetAll(ApiUrls.IssuesEvents(repositoryId), - null, - AcceptHeaders.IssueEventsApiPreview, - options); + return ApiConnection.GetAll(ApiUrls.IssuesEvents(repositoryId), null, options); } /// @@ -174,16 +158,13 @@ public Task> GetAllForRepository(long repositoryId, Ap /// The owner of the repository /// The name of the repository /// The event id - [Preview("starfox")] [ManualRoute("GET", "/repos/{owner}/{repo}/issues/events/{event_id}")] public Task Get(string owner, string name, long eventId) { Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner)); Ensure.ArgumentNotNullOrEmptyString(name, nameof(name)); - return ApiConnection.Get(ApiUrls.IssuesEvent(owner, name, eventId), - null, - AcceptHeaders.IssueEventsApiPreview); + return ApiConnection.Get(ApiUrls.IssuesEvent(owner, name, eventId), null); } /// @@ -194,13 +175,10 @@ public Task Get(string owner, string name, long eventId) /// /// The Id of the repository /// The event id - [Preview("starfox")] [ManualRoute("GET", "/repositories/{id}/issues/events/{event_id}")] public Task Get(long repositoryId, long eventId) { - return ApiConnection.Get(ApiUrls.IssuesEvent(repositoryId, eventId), - null, - AcceptHeaders.IssueEventsApiPreview); + return ApiConnection.Get(ApiUrls.IssuesEvent(repositoryId, eventId), null); } } } diff --git a/Octokit/Clients/MigrationsClient.cs b/Octokit/Clients/MigrationsClient.cs index 4f5a0e2d07..a7feeae4c8 100644 --- a/Octokit/Clients/MigrationsClient.cs +++ b/Octokit/Clients/MigrationsClient.cs @@ -30,7 +30,6 @@ public MigrationsClient(IApiConnection apiConnection) : base(apiConnection) /// Specifies parameters for the migration in a /// object. /// The started migration. - [Preview("wyandotte")] [ManualRoute("POST", "/orgs/{org}/migrations")] public async Task Start(string org, StartMigrationRequest migration) { @@ -39,7 +38,7 @@ public async Task Start(string org, StartMigrationRequest migration) var endpoint = ApiUrls.EnterpriseMigrations(org); - return await ApiConnection.Post(endpoint, migration, AcceptHeaders.MigrationsApiPreview).ConfigureAwait(false); + return await ApiConnection.Post(endpoint, migration).ConfigureAwait(false); } /// @@ -66,7 +65,6 @@ public async Task> GetAll(string org) /// Options for changing the API response /// List of most recent s. [ManualRoute("GET", "/orgs/{org}/migrations")] - [Preview("wyandotte")] public async Task> GetAll(string org, ApiOptions options) { Ensure.ArgumentNotNullOrEmptyString(org, nameof(org)); @@ -74,7 +72,7 @@ public async Task> GetAll(string org, ApiOptions option var endpoint = ApiUrls.EnterpriseMigrations(org); - return await ApiConnection.GetAll(endpoint, null, AcceptHeaders.MigrationsApiPreview, options).ConfigureAwait(false); + return await ApiConnection.GetAll(endpoint, null, options).ConfigureAwait(false); } /// @@ -86,7 +84,6 @@ public async Task> GetAll(string org, ApiOptions option /// The organization which is migrating. /// Migration Id of the organization. /// A object representing the state of migration. - [Preview("wyandotte")] [ManualRoute("GET", "/orgs/{org}/migrations/{id}")] public async Task Get(string org, int id) { @@ -94,7 +91,7 @@ public async Task Get(string org, int id) var endpoint = ApiUrls.EnterpriseMigrationById(org, id); - return await ApiConnection.Get(endpoint, null, AcceptHeaders.MigrationsApiPreview).ConfigureAwait(false); + return await ApiConnection.Get(endpoint, null).ConfigureAwait(false); } /// @@ -106,14 +103,13 @@ public async Task Get(string org, int id) /// The organization of which the migration was. /// The Id of the migration. /// The binary contents of the archive as a byte array. - [Preview("wyandotte")] [ManualRoute("GET", "/orgs/{org}/migrations/{id}/archive")] public async Task GetArchive(string org, int id) { Ensure.ArgumentNotNullOrEmptyString(org, nameof(org)); var endpoint = ApiUrls.EnterpriseMigrationArchive(org, id); - var response = await Connection.Get(endpoint, null, AcceptHeaders.MigrationsApiPreview).ConfigureAwait(false); + var response = await Connection.GetRaw(endpoint, null).ConfigureAwait(false); return response.Body; } @@ -127,7 +123,6 @@ public async Task GetArchive(string org, int id) /// The organization of which the migration was. /// The Id of the migration. /// - [Preview("wyandotte")] [ManualRoute("DELETE", "/orgs/{org}/migrations/{id}/archive")] public Task DeleteArchive(string org, int id) { @@ -135,7 +130,7 @@ public Task DeleteArchive(string org, int id) var endpoint = ApiUrls.EnterpriseMigrationArchive(org, id); - return ApiConnection.Delete(endpoint, new object(), AcceptHeaders.MigrationsApiPreview); + return ApiConnection.Delete(endpoint, new object()); } /// @@ -148,7 +143,6 @@ public Task DeleteArchive(string org, int id) /// The Id of the migration. /// The repo to unlock. /// - [Preview("wyandotte")] [ManualRoute("GET", "/orgs/{org}/migrations/{id}/repos/{name}/lock")] public Task UnlockRepository(string org, int id, string repo) { @@ -157,7 +151,7 @@ public Task UnlockRepository(string org, int id, string repo) var endpoint = ApiUrls.EnterpriseMigrationUnlockRepository(org, id, repo); - return ApiConnection.Delete(endpoint, new object(), AcceptHeaders.MigrationsApiPreview); + return ApiConnection.Delete(endpoint, new object()); } } } diff --git a/Octokit/Clients/OrganizationMembersClient.cs b/Octokit/Clients/OrganizationMembersClient.cs index 53714bddca..ca2931ed37 100644 --- a/Octokit/Clients/OrganizationMembersClient.cs +++ b/Octokit/Clients/OrganizationMembersClient.cs @@ -565,7 +565,7 @@ public Task> GetAllPendingInvita Ensure.ArgumentNotNullOrEmptyString(org, nameof(org)); Ensure.ArgumentNotNull(options, nameof(options)); - return ApiConnection.GetAll(ApiUrls.OrganizationPendingInvititations(org), null, AcceptHeaders.OrganizationMembershipPreview, options); + return ApiConnection.GetAll(ApiUrls.OrganizationPendingInvititations(org), null, options); } } } diff --git a/Octokit/Clients/OrganizationOutsideCollaboratorsClient.cs b/Octokit/Clients/OrganizationOutsideCollaboratorsClient.cs index 6194da1b66..8b68009075 100644 --- a/Octokit/Clients/OrganizationOutsideCollaboratorsClient.cs +++ b/Octokit/Clients/OrganizationOutsideCollaboratorsClient.cs @@ -57,7 +57,7 @@ public Task> GetAll(string org, ApiOptions options) Ensure.ArgumentNotNullOrEmptyString(org, nameof(org)); Ensure.ArgumentNotNull(options, nameof(options)); - return ApiConnection.GetAll(ApiUrls.OutsideCollaborators(org), null, AcceptHeaders.OrganizationMembershipPreview, options); + return ApiConnection.GetAll(ApiUrls.OutsideCollaborators(org), null, options); } /// @@ -97,7 +97,7 @@ public Task> GetAll(string org, OrganizationMembersFilter fi Ensure.ArgumentNotNullOrEmptyString(org, nameof(org)); Ensure.ArgumentNotNull(options, nameof(options)); - return ApiConnection.GetAll(ApiUrls.OutsideCollaborators(org, filter), null, AcceptHeaders.OrganizationMembershipPreview, options); + return ApiConnection.GetAll(ApiUrls.OutsideCollaborators(org, filter), null, options); } /// @@ -119,7 +119,7 @@ public async Task Delete(string org, string user) try { - var statusCode = await Connection.Delete(ApiUrls.OutsideCollaborator(org, user), null, AcceptHeaders.OrganizationMembershipPreview).ConfigureAwait(false); + var statusCode = await Connection.Delete(ApiUrls.OutsideCollaborator(org, user), null).ConfigureAwait(false); if (statusCode != HttpStatusCode.NoContent && statusCode != (HttpStatusCode)422) @@ -160,7 +160,7 @@ public async Task ConvertFromMember(string org, string user) try { - var statusCode = await Connection.Put(ApiUrls.OutsideCollaborator(org, user), AcceptHeaders.OrganizationMembershipPreview); + var statusCode = await Connection.Put(ApiUrls.OutsideCollaborator(org, user)); if (statusCode != HttpStatusCode.NoContent && statusCode != HttpStatusCode.Forbidden) diff --git a/Octokit/Clients/ProjectCardsClient.cs b/Octokit/Clients/ProjectCardsClient.cs index 93556e26ca..0b3cb81f37 100644 --- a/Octokit/Clients/ProjectCardsClient.cs +++ b/Octokit/Clients/ProjectCardsClient.cs @@ -71,14 +71,13 @@ public Task> GetAll(int columnId, ProjectCardRequest /// The id of the column /// Used to filter the list of project cards returned /// Options for changing the API response - [Preview("inertia")] [ManualRoute("GET", "/projects/columns/{column_id}/cards")] public Task> GetAll(int columnId, ProjectCardRequest request, ApiOptions options) { Ensure.ArgumentNotNull(request, nameof(request)); Ensure.ArgumentNotNull(options, nameof(options)); - return ApiConnection.GetAll(ApiUrls.ProjectCards(columnId), request.ToParametersDictionary(), AcceptHeaders.ProjectsApiPreview, options); + return ApiConnection.GetAll(ApiUrls.ProjectCards(columnId), request.ToParametersDictionary(), options); } /// @@ -88,11 +87,10 @@ public Task> GetAll(int columnId, ProjectCardRequest /// See the API documentation for more information. /// /// The id of the card - [Preview("inertia")] [ManualRoute("GET", "/projects/columns/cards/{card_id}")] public Task Get(int id) { - return ApiConnection.Get(ApiUrls.ProjectCard(id), null, AcceptHeaders.ProjectsApiPreview); + return ApiConnection.Get(ApiUrls.ProjectCard(id), null); } /// @@ -103,13 +101,12 @@ public Task Get(int id) /// /// The id of the column /// The card to create - [Preview("inertia")] [ManualRoute("POST", "/projects/columns/{column_id}/cards")] public Task Create(int columnId, NewProjectCard newProjectCard) { Ensure.ArgumentNotNull(newProjectCard, nameof(newProjectCard)); - return ApiConnection.Post(ApiUrls.ProjectCards(columnId), newProjectCard, AcceptHeaders.ProjectsApiPreview); + return ApiConnection.Post(ApiUrls.ProjectCards(columnId), newProjectCard); } /// @@ -120,13 +117,12 @@ public Task Create(int columnId, NewProjectCard newProjectCard) /// /// The id of the card /// New values to update the card with - [Preview("inertia")] [ManualRoute("GET", "/projects/columns/cards/{card_id}")] public Task Update(int id, ProjectCardUpdate projectCardUpdate) { Ensure.ArgumentNotNull(projectCardUpdate, nameof(projectCardUpdate)); - return ApiConnection.Patch(ApiUrls.ProjectCard(id), projectCardUpdate, AcceptHeaders.ProjectsApiPreview); + return ApiConnection.Patch(ApiUrls.ProjectCard(id), projectCardUpdate); } /// @@ -136,7 +132,6 @@ public Task Update(int id, ProjectCardUpdate projectCardUpdate) /// See the API documentation for more information. /// /// The id of the card - [Preview("inertia")] [ManualRoute("DELETE", "/projects/columns/cards/{card_id}")] public async Task Delete(int id) { @@ -144,7 +139,7 @@ public async Task Delete(int id) try { - var httpStatusCode = await Connection.Delete(endpoint, new object(), AcceptHeaders.ProjectsApiPreview).ConfigureAwait(false); + var httpStatusCode = await Connection.Delete(endpoint, new object()).ConfigureAwait(false); return httpStatusCode == HttpStatusCode.NoContent; } catch (NotFoundException) @@ -161,7 +156,6 @@ public async Task Delete(int id) /// /// The id of the card /// The position to move the card - [Preview("inertia")] [ManualRoute("POST", "/projects/columns/cards/{card_id}/moves")] public async Task Move(int id, ProjectCardMove position) { @@ -170,7 +164,7 @@ public async Task Move(int id, ProjectCardMove position) var endpoint = ApiUrls.ProjectCardMove(id); try { - var httpStatusCode = await Connection.Post(endpoint, position, AcceptHeaders.ProjectsApiPreview).ConfigureAwait(false); + var httpStatusCode = await Connection.Post(endpoint, position, null).ConfigureAwait(false); return httpStatusCode == HttpStatusCode.Created; } catch (NotFoundException) diff --git a/Octokit/Clients/ProjectColumnsClient.cs b/Octokit/Clients/ProjectColumnsClient.cs index 4c9fc2b7f0..5dce16f23f 100644 --- a/Octokit/Clients/ProjectColumnsClient.cs +++ b/Octokit/Clients/ProjectColumnsClient.cs @@ -38,13 +38,12 @@ public Task> GetAll(int projectId) /// /// The Id of the project /// Options for changing the API response - [Preview("inertia")] [ManualRoute("GET", "/projects/{project_id}/columns")] public Task> GetAll(int projectId, ApiOptions options) { Ensure.ArgumentNotNull(options, nameof(options)); - return ApiConnection.GetAll(ApiUrls.ProjectColumns(projectId), new Dictionary(), AcceptHeaders.ProjectsApiPreview, options); + return ApiConnection.GetAll(ApiUrls.ProjectColumns(projectId), new Dictionary(), options); } /// @@ -54,11 +53,10 @@ public Task> GetAll(int projectId, ApiOptions optio /// See the API documentation for more information. /// /// The id of the column - [Preview("inertia")] [ManualRoute("GET", "/projects/columns/{column_id}")] public Task Get(int id) { - return ApiConnection.Get(ApiUrls.ProjectColumn(id), null, AcceptHeaders.ProjectsApiPreview); + return ApiConnection.Get(ApiUrls.ProjectColumn(id), null); } /// @@ -69,13 +67,12 @@ public Task Get(int id) /// /// The Id of the project /// The column to create - [Preview("inertia")] [ManualRoute("POST", "/projects/{project_id}/columns")] public Task Create(int projectId, NewProjectColumn newProjectColumn) { Ensure.ArgumentNotNull(newProjectColumn, nameof(newProjectColumn)); - return ApiConnection.Post(ApiUrls.ProjectColumns(projectId), newProjectColumn, AcceptHeaders.ProjectsApiPreview); + return ApiConnection.Post(ApiUrls.ProjectColumns(projectId), newProjectColumn); } /// @@ -86,13 +83,12 @@ public Task Create(int projectId, NewProjectColumn newProjectColu /// /// The id of the column /// New values to update the column with - [Preview("inertia")] [ManualRoute("PATCH", "/projects/columns/{column_id}")] public Task Update(int id, ProjectColumnUpdate projectColumnUpdate) { Ensure.ArgumentNotNull(projectColumnUpdate, nameof(projectColumnUpdate)); - return ApiConnection.Patch(ApiUrls.ProjectColumn(id), projectColumnUpdate, AcceptHeaders.ProjectsApiPreview); + return ApiConnection.Patch(ApiUrls.ProjectColumn(id), projectColumnUpdate); } /// @@ -102,14 +98,13 @@ public Task Update(int id, ProjectColumnUpdate projectColumnUpdat /// See the API documentation for more information. /// /// The id of the column - [Preview("inertia")] [ManualRoute("DELETE", "/projects/columns/{column_id}")] public async Task Delete(int id) { var endpoint = ApiUrls.ProjectColumn(id); try { - var httpStatusCode = await Connection.Delete(endpoint, new object(), AcceptHeaders.ProjectsApiPreview).ConfigureAwait(false); + var httpStatusCode = await Connection.Delete(endpoint, new object()).ConfigureAwait(false); return httpStatusCode == HttpStatusCode.NoContent; } catch (NotFoundException) @@ -126,7 +121,6 @@ public async Task Delete(int id) /// /// The id of the column /// The position to move the column - [Preview("inertia")] [ManualRoute("POST", "/projects/columns/{column_id}/moves")] public async Task Move(int id, ProjectColumnMove position) { @@ -135,7 +129,7 @@ public async Task Move(int id, ProjectColumnMove position) var endpoint = ApiUrls.ProjectColumnMove(id); try { - var httpStatusCode = await Connection.Post(endpoint, position, AcceptHeaders.ProjectsApiPreview).ConfigureAwait(false); + var httpStatusCode = await Connection.Post(endpoint, position, null).ConfigureAwait(false); return httpStatusCode == HttpStatusCode.Created; } catch (NotFoundException) diff --git a/Octokit/Clients/ProjectsClient.cs b/Octokit/Clients/ProjectsClient.cs index 97e3d108b2..c7b30ec3ca 100644 --- a/Octokit/Clients/ProjectsClient.cs +++ b/Octokit/Clients/ProjectsClient.cs @@ -43,7 +43,6 @@ public Task> GetAllForRepository(string owner, string nam /// The owner of the repository /// The name of the repository /// Options for changing the API response - [Preview("inertia")] [ManualRoute("GET", "/repos/{owner}/{repo}/projects")] public Task> GetAllForRepository(string owner, string name, ApiOptions options) { @@ -51,7 +50,7 @@ public Task> GetAllForRepository(string owner, string nam Ensure.ArgumentNotNullOrEmptyString(name, nameof(name)); Ensure.ArgumentNotNull(options, nameof(options)); - return ApiConnection.GetAll(ApiUrls.RepositoryProjects(owner, name), new Dictionary(), AcceptHeaders.ProjectsApiPreview, options); + return ApiConnection.GetAll(ApiUrls.RepositoryProjects(owner, name), new Dictionary(), options); } /// @@ -79,7 +78,6 @@ public Task> GetAllForRepository(string owner, string nam /// The name of the repository /// Used to filter the list of projects returned /// Options for changing the API response - [Preview("inertia")] [ManualRoute("GET", "/repos/{owner}/{repo}/projects")] public Task> GetAllForRepository(string owner, string name, ProjectRequest request, ApiOptions options) { @@ -88,7 +86,7 @@ public Task> GetAllForRepository(string owner, string nam Ensure.ArgumentNotNull(request, nameof(request)); Ensure.ArgumentNotNull(options, nameof(options)); - return ApiConnection.GetAll(ApiUrls.RepositoryProjects(owner, name), request.ToParametersDictionary(), AcceptHeaders.ProjectsApiPreview, options); + return ApiConnection.GetAll(ApiUrls.RepositoryProjects(owner, name), request.ToParametersDictionary(), options); } /// @@ -112,13 +110,12 @@ public Task> GetAllForRepository(long repositoryId) /// /// The Id of the repository /// Options for changing the API response - [Preview("inertia")] [ManualRoute("GET", "/repositories/{id}/projects")] public Task> GetAllForRepository(long repositoryId, ApiOptions options) { Ensure.ArgumentNotNull(options, nameof(options)); - return ApiConnection.GetAll(ApiUrls.RepositoryProjects(repositoryId), new Dictionary(), AcceptHeaders.ProjectsApiPreview, options); + return ApiConnection.GetAll(ApiUrls.RepositoryProjects(repositoryId), new Dictionary(), options); } /// @@ -144,14 +141,13 @@ public Task> GetAllForRepository(long repositoryId, Proje /// The Id of the repository /// Used to filter the list of projects returned /// Options for changing the API response - [Preview("inertia")] [ManualRoute("GET", "/repositories/{id}/projects")] public Task> GetAllForRepository(long repositoryId, ProjectRequest request, ApiOptions options) { Ensure.ArgumentNotNull(request, nameof(request)); Ensure.ArgumentNotNull(options, nameof(options)); - return ApiConnection.GetAll(ApiUrls.RepositoryProjects(repositoryId), request.ToParametersDictionary(), AcceptHeaders.ProjectsApiPreview, options); + return ApiConnection.GetAll(ApiUrls.RepositoryProjects(repositoryId), request.ToParametersDictionary(), options); } /// @@ -175,7 +171,6 @@ public Task> GetAllForOrganization(string organization) /// /// The name of the organization /// Options for changing the API response - [Preview("inertia")] [ManualRoute("GET", "/orgs/{org}/projects")] public Task> GetAllForOrganization(string organization, ApiOptions options) { @@ -183,7 +178,7 @@ public Task> GetAllForOrganization(string organization, A Ensure.ArgumentNotNull(options, nameof(options)); - return ApiConnection.GetAll(ApiUrls.OrganizationProjects(organization), new Dictionary(), AcceptHeaders.ProjectsApiPreview, options); + return ApiConnection.GetAll(ApiUrls.OrganizationProjects(organization), new Dictionary(), options); } /// @@ -212,7 +207,6 @@ public Task> GetAllForOrganization(string organization, P /// The name of the organization /// Used to filter the list of projects returned /// Options for changing the API response - [Preview("inertia")] [ManualRoute("GET", "/orgs/{org}/projects")] public Task> GetAllForOrganization(string organization, ProjectRequest request, ApiOptions options) { @@ -220,7 +214,7 @@ public Task> GetAllForOrganization(string organization, P Ensure.ArgumentNotNull(request, nameof(request)); Ensure.ArgumentNotNull(options, nameof(options)); - return ApiConnection.GetAll(ApiUrls.OrganizationProjects(organization), request.ToParametersDictionary(), AcceptHeaders.ProjectsApiPreview, options); + return ApiConnection.GetAll(ApiUrls.OrganizationProjects(organization), request.ToParametersDictionary(), options); } /// @@ -230,11 +224,10 @@ public Task> GetAllForOrganization(string organization, P /// See the API documentation for more information. /// /// The Id of the project - [Preview("inertia")] [ManualRoute("GET", "/projects/{project_id}")] public Task Get(int id) { - return ApiConnection.Get(ApiUrls.Project(id), null, AcceptHeaders.ProjectsApiPreview); + return ApiConnection.Get(ApiUrls.Project(id), null); } // NOTE: I think we're missing a Task CreateForRepository(owner, name, newProject) @@ -248,13 +241,12 @@ public Task Get(int id) /// /// The Id of the repository /// The new project to create for this repository - [Preview("inertia")] [ManualRoute("POST", "/repositories/{id}/projects")] public Task CreateForRepository(long repositoryId, NewProject newProject) { Ensure.ArgumentNotNull(newProject, nameof(newProject)); - return ApiConnection.Post(ApiUrls.RepositoryProjects(repositoryId), newProject, AcceptHeaders.ProjectsApiPreview); + return ApiConnection.Post(ApiUrls.RepositoryProjects(repositoryId), newProject); } /// @@ -265,14 +257,13 @@ public Task CreateForRepository(long repositoryId, NewProject newProjec /// /// The name of the organization /// The new project to create for this repository - [Preview("inertia")] [ManualRoute("POST", "/orgs/{org}/projects")] public Task CreateForOrganization(string organization, NewProject newProject) { Ensure.ArgumentNotNullOrEmptyString(organization, nameof(organization)); Ensure.ArgumentNotNull(newProject, nameof(newProject)); - return ApiConnection.Post(ApiUrls.OrganizationProjects(organization), newProject, AcceptHeaders.ProjectsApiPreview); + return ApiConnection.Post(ApiUrls.OrganizationProjects(organization), newProject); } /// @@ -283,13 +274,12 @@ public Task CreateForOrganization(string organization, NewProject newPr /// /// The Id of the project /// The modified project - [Preview("inertia")] [ManualRoute("PATCH", "/project/{project_id}")] public Task Update(int id, ProjectUpdate projectUpdate) { Ensure.ArgumentNotNull(projectUpdate, nameof(projectUpdate)); - return ApiConnection.Patch(ApiUrls.Project(id), projectUpdate, AcceptHeaders.ProjectsApiPreview); + return ApiConnection.Patch(ApiUrls.Project(id), projectUpdate); } /// @@ -299,7 +289,6 @@ public Task Update(int id, ProjectUpdate projectUpdate) /// See the API documentation for more information. /// /// The Id of the project - [Preview("inertia")] [ManualRoute("DELETE", "/project/{project_id}")] public async Task Delete(int id) { @@ -307,7 +296,7 @@ public async Task Delete(int id) try { - var httpStatusCode = await Connection.Delete(endpoint, new object(), AcceptHeaders.ProjectsApiPreview).ConfigureAwait(false); + var httpStatusCode = await Connection.Delete(endpoint, new object()).ConfigureAwait(false); return httpStatusCode == HttpStatusCode.NoContent; } catch (NotFoundException) diff --git a/Octokit/Clients/PullRequestReviewCommentReactionsClient.cs b/Octokit/Clients/PullRequestReviewCommentReactionsClient.cs index a76ef8c549..09876a507d 100644 --- a/Octokit/Clients/PullRequestReviewCommentReactionsClient.cs +++ b/Octokit/Clients/PullRequestReviewCommentReactionsClient.cs @@ -37,7 +37,6 @@ public Task> GetAll(string owner, string name, int numbe /// The name of the repository /// The comment id /// Options for changing the API response - [Preview("squirrel-girl")] [ManualRoute("GET", "/repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions")] public Task> GetAll(string owner, string name, int number, ApiOptions options) { @@ -45,7 +44,7 @@ public Task> GetAll(string owner, string name, int numbe Ensure.ArgumentNotNullOrEmptyString(name, nameof(name)); Ensure.ArgumentNotNull(options, nameof(options)); - return ApiConnection.GetAll(ApiUrls.PullRequestReviewCommentReactions(owner, name, number), null, AcceptHeaders.ReactionsPreview, options); + return ApiConnection.GetAll(ApiUrls.PullRequestReviewCommentReactions(owner, name, number), null, options); } /// @@ -67,13 +66,12 @@ public Task> GetAll(long repositoryId, int number) /// The Id of the repository /// The comment id /// Options for changing the API response - [Preview("squirrel-girl")] [ManualRoute("GET", "/repositories/{id}/pulls/comments/{comment_id}/reactions")] public Task> GetAll(long repositoryId, int number, ApiOptions options) { Ensure.ArgumentNotNull(options, nameof(options)); - return ApiConnection.GetAll(ApiUrls.PullRequestReviewCommentReactions(repositoryId, number), null, AcceptHeaders.ReactionsPreview, options); + return ApiConnection.GetAll(ApiUrls.PullRequestReviewCommentReactions(repositoryId, number), null, options); } /// @@ -84,7 +82,6 @@ public Task> GetAll(long repositoryId, int number, ApiOp /// The name of the repository /// The comment id /// The reaction to create - [Preview("squirrel-girl")] [ManualRoute("POST", "/repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions")] public Task Create(string owner, string name, int number, NewReaction reaction) { @@ -92,7 +89,7 @@ public Task Create(string owner, string name, int number, NewReaction Ensure.ArgumentNotNullOrEmptyString(name, nameof(name)); Ensure.ArgumentNotNull(reaction, nameof(reaction)); - return ApiConnection.Post(ApiUrls.PullRequestReviewCommentReactions(owner, name, number), reaction, AcceptHeaders.ReactionsPreview); + return ApiConnection.Post(ApiUrls.PullRequestReviewCommentReactions(owner, name, number), reaction); } /// @@ -102,13 +99,12 @@ public Task Create(string owner, string name, int number, NewReaction /// The Id of the repository /// The comment id /// The reaction to create - [Preview("squirrel-girl")] [ManualRoute("POST", "/repositories/{id}/pulls/comments/{comment_id}/reactions")] public Task Create(long repositoryId, int number, NewReaction reaction) { Ensure.ArgumentNotNull(reaction, nameof(reaction)); - return ApiConnection.Post(ApiUrls.PullRequestReviewCommentReactions(repositoryId, number), reaction, AcceptHeaders.ReactionsPreview); + return ApiConnection.Post(ApiUrls.PullRequestReviewCommentReactions(repositoryId, number), reaction); } /// diff --git a/Octokit/Clients/PullRequestReviewCommentsClient.cs b/Octokit/Clients/PullRequestReviewCommentsClient.cs index d0682d2e84..658146d025 100644 --- a/Octokit/Clients/PullRequestReviewCommentsClient.cs +++ b/Octokit/Clients/PullRequestReviewCommentsClient.cs @@ -54,14 +54,13 @@ public Task> GetAll(long repositoryId, i /// The pull request number /// Options for changing the API response [ManualRoute("GET", "/repos/{owner}/{repo}/pulls/{pull_number}/comments")] - [Preview("squirrel-girl")] public Task> GetAll(string owner, string name, int number, ApiOptions options) { Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner)); Ensure.ArgumentNotNullOrEmptyString(name, nameof(name)); Ensure.ArgumentNotNull(options, nameof(options)); - return ApiConnection.GetAll(ApiUrls.PullRequestReviewComments(owner, name, number), null, AcceptHeaders.ReactionsPreview, options); + return ApiConnection.GetAll(ApiUrls.PullRequestReviewComments(owner, name, number), null, options); } /// @@ -175,7 +174,6 @@ public Task> GetAllForRepository(long re /// The name of the repository /// The sorting parameters /// Options for changing the API response - [Preview("squirrel-girl")] [ManualRoute("GET", "/repos/{owner}/{repo}/pulls/comments")] public Task> GetAllForRepository(string owner, string name, PullRequestReviewCommentRequest request, ApiOptions options) { @@ -184,7 +182,7 @@ public Task> GetAllForRepository(string Ensure.ArgumentNotNull(request, nameof(request)); Ensure.ArgumentNotNull(options, nameof(options)); - return ApiConnection.GetAll(ApiUrls.PullRequestReviewCommentsRepository(owner, name), request.ToParametersDictionary(), AcceptHeaders.ReactionsPreview, options); + return ApiConnection.GetAll(ApiUrls.PullRequestReviewCommentsRepository(owner, name), request.ToParametersDictionary(), options); } /// @@ -194,14 +192,13 @@ public Task> GetAllForRepository(string /// The Id of the repository /// The sorting parameters /// Options for changing the API response - [Preview("squirrel-girl")] [ManualRoute("GET", "/repositories/{id}/pulls/comments")] public Task> GetAllForRepository(long repositoryId, PullRequestReviewCommentRequest request, ApiOptions options) { Ensure.ArgumentNotNull(request, nameof(request)); Ensure.ArgumentNotNull(options, nameof(options)); - return ApiConnection.GetAll(ApiUrls.PullRequestReviewCommentsRepository(repositoryId), request.ToParametersDictionary(), AcceptHeaders.ReactionsPreview, options); + return ApiConnection.GetAll(ApiUrls.PullRequestReviewCommentsRepository(repositoryId), request.ToParametersDictionary(), options); } /// @@ -211,14 +208,13 @@ public Task> GetAllForRepository(long re /// The owner of the repository /// The name of the repository /// The pull request review comment number - [Preview("squirrel-girl")] [ManualRoute("GET", "/repos/{owner}/{repo}/pulls/comments/{comment_id}")] public Task GetComment(string owner, string name, int number) { Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner)); Ensure.ArgumentNotNullOrEmptyString(name, nameof(name)); - return ApiConnection.Get(ApiUrls.PullRequestReviewComment(owner, name, number), new Dictionary(), AcceptHeaders.ReactionsPreview); + return ApiConnection.Get(ApiUrls.PullRequestReviewComment(owner, name, number), new Dictionary()); } /// diff --git a/Octokit/Clients/PullRequestsClient.cs b/Octokit/Clients/PullRequestsClient.cs index 0a60cb862c..07c63b9748 100644 --- a/Octokit/Clients/PullRequestsClient.cs +++ b/Octokit/Clients/PullRequestsClient.cs @@ -41,14 +41,13 @@ public PullRequestsClient(IApiConnection apiConnection) : base(apiConnection) /// /// http://developer.github.com/v3/pulls/#get-a-single-pull-request /// - [Preview("shadow-cat")] [ManualRoute("GET", "/repos/{owner}/{repo}/pulls/{pull_number}")] public Task Get(string owner, string name, int number) { Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner)); Ensure.ArgumentNotNullOrEmptyString(name, nameof(name)); - return ApiConnection.Get(ApiUrls.PullRequest(owner, name, number), null, AcceptHeaders.DraftPullRequestApiPreview); + return ApiConnection.Get(ApiUrls.PullRequest(owner, name, number), null); } /// @@ -57,11 +56,10 @@ public Task Get(string owner, string name, int number) /// /// http://developer.github.com/v3/pulls/#get-a-single-pull-request /// - [Preview("shadow-cat")] [ManualRoute("GET", "/repositories/{id}/pulls/{number}")] public Task Get(long repositoryId, int number) { - return ApiConnection.Get(ApiUrls.PullRequest(repositoryId, number), null, AcceptHeaders.DraftPullRequestApiPreview); + return ApiConnection.Get(ApiUrls.PullRequest(repositoryId, number), null); } /// @@ -174,7 +172,6 @@ public Task> GetAllForRepository(long repositoryId, P /// The name of the repository /// Used to filter and sort the list of pull requests returned /// Options for changing the API response - [Preview("shadow-cat")] [ManualRoute("GET", "/repos/{owner}/{repo}/pulls")] public Task> GetAllForRepository(string owner, string name, PullRequestRequest request, ApiOptions options) { @@ -183,8 +180,7 @@ public Task> GetAllForRepository(string owner, string Ensure.ArgumentNotNull(request, nameof(request)); Ensure.ArgumentNotNull(options, nameof(options)); - return ApiConnection.GetAll(ApiUrls.PullRequests(owner, name), - request.ToParametersDictionary(), AcceptHeaders.DraftPullRequestApiPreview, options); + return ApiConnection.GetAll(ApiUrls.PullRequests(owner, name), request.ToParametersDictionary(), options); } /// @@ -196,15 +192,13 @@ public Task> GetAllForRepository(string owner, string /// The Id of the repository /// Used to filter and sort the list of pull requests returned /// Options for changing the API response - [Preview("shadow-cat")] [ManualRoute("GET", "/repositories/{id}/pulls")] public Task> GetAllForRepository(long repositoryId, PullRequestRequest request, ApiOptions options) { Ensure.ArgumentNotNull(request, nameof(request)); Ensure.ArgumentNotNull(options, nameof(options)); - return ApiConnection.GetAll(ApiUrls.PullRequests(repositoryId), - request.ToParametersDictionary(), AcceptHeaders.DraftPullRequestApiPreview, options); + return ApiConnection.GetAll(ApiUrls.PullRequests(repositoryId), request.ToParametersDictionary(), options); } /// @@ -214,7 +208,6 @@ public Task> GetAllForRepository(long repositoryId, P /// The owner of the repository /// The name of the repository /// A instance describing the new PullRequest to create - [Preview("shadow-cat")] [ManualRoute("POST", "/repos/{owner}/{repo}/pulls")] public Task Create(string owner, string name, NewPullRequest newPullRequest) { @@ -222,7 +215,7 @@ public Task Create(string owner, string name, NewPullRequest newPul Ensure.ArgumentNotNullOrEmptyString(name, nameof(name)); Ensure.ArgumentNotNull(newPullRequest, nameof(newPullRequest)); - return ApiConnection.Post(ApiUrls.PullRequests(owner, name), newPullRequest, AcceptHeaders.DraftPullRequestApiPreview); + return ApiConnection.Post(ApiUrls.PullRequests(owner, name), newPullRequest); } /// @@ -231,13 +224,12 @@ public Task Create(string owner, string name, NewPullRequest newPul /// http://developer.github.com/v3/pulls/#create-a-pull-request /// The Id of the repository /// A instance describing the new PullRequest to create - [Preview("shadow-cat")] [ManualRoute("POST", "/repositories/{id}/pulls")] public Task Create(long repositoryId, NewPullRequest newPullRequest) { Ensure.ArgumentNotNull(newPullRequest, nameof(newPullRequest)); - return ApiConnection.Post(ApiUrls.PullRequests(repositoryId), newPullRequest, AcceptHeaders.DraftPullRequestApiPreview); + return ApiConnection.Post(ApiUrls.PullRequests(repositoryId), newPullRequest); } /// @@ -249,7 +241,6 @@ public Task Create(long repositoryId, NewPullRequest newPullRequest /// The PullRequest number /// An instance describing the changes to make to the PullRequest /// - [Preview("shadow-cat")] [ManualRoute("PATCH", "/repos/{owner}/{repo}/pulls/{pull_number}")] public Task Update(string owner, string name, int number, PullRequestUpdate pullRequestUpdate) { @@ -257,7 +248,7 @@ public Task Update(string owner, string name, int number, PullReque Ensure.ArgumentNotNullOrEmptyString(name, nameof(name)); Ensure.ArgumentNotNull(pullRequestUpdate, nameof(pullRequestUpdate)); - return ApiConnection.Patch(ApiUrls.PullRequest(owner, name, number), pullRequestUpdate, AcceptHeaders.DraftPullRequestApiPreview); + return ApiConnection.Patch(ApiUrls.PullRequest(owner, name, number), pullRequestUpdate); } /// @@ -268,13 +259,12 @@ public Task Update(string owner, string name, int number, PullReque /// The PullRequest number /// An instance describing the changes to make to the PullRequest /// - [Preview("shadow-cat")] [ManualRoute("PATCH", "/repositories/{id}/pulls/{number}")] public Task Update(long repositoryId, int number, PullRequestUpdate pullRequestUpdate) { Ensure.ArgumentNotNull(pullRequestUpdate, nameof(pullRequestUpdate)); - return ApiConnection.Patch(ApiUrls.PullRequest(repositoryId, number), pullRequestUpdate, AcceptHeaders.DraftPullRequestApiPreview); + return ApiConnection.Patch(ApiUrls.PullRequest(repositoryId, number), pullRequestUpdate); } /// diff --git a/Octokit/Clients/ReactionsClient.cs b/Octokit/Clients/ReactionsClient.cs index eabca26b22..4d1f3947a6 100644 --- a/Octokit/Clients/ReactionsClient.cs +++ b/Octokit/Clients/ReactionsClient.cs @@ -56,12 +56,11 @@ public ReactionsClient(IApiConnection apiConnection) /// https://developer.github.com/v3/reactions/#delete-a-reaction /// The reaction id /// - [Preview("squirrel-girl")] [ManualRoute("DELETE", "/reactions/{reaction_id}")] [Obsolete("This route no longer works and is replaced with individual routes in each client")] public Task Delete(int number) { - return ApiConnection.Delete(ApiUrls.Reactions(number), new object(), AcceptHeaders.ReactionsPreview); + return ApiConnection.Delete(ApiUrls.Reactions(number), new object()); } } } diff --git a/Octokit/Clients/RepoCollaboratorsClient.cs b/Octokit/Clients/RepoCollaboratorsClient.cs index 656e282e36..c91639d535 100644 --- a/Octokit/Clients/RepoCollaboratorsClient.cs +++ b/Octokit/Clients/RepoCollaboratorsClient.cs @@ -239,7 +239,7 @@ public Task ReviewPermission(string owner, string name, Ensure.ArgumentNotNullOrEmptyString(user, nameof(user)); return ApiConnection - .Get(ApiUrls.RepoCollaboratorPermission(owner, name, user), null, AcceptHeaders.OrganizationMembershipPreview); + .Get(ApiUrls.RepoCollaboratorPermission(owner, name, user), null); } /// @@ -257,7 +257,7 @@ public Task ReviewPermission(long repositoryId, string u Ensure.ArgumentNotNullOrEmptyString(user, nameof(user)); return ApiConnection - .Get(ApiUrls.RepoCollaboratorPermission(repositoryId, user), null, AcceptHeaders.OrganizationMembershipPreview); + .Get(ApiUrls.RepoCollaboratorPermission(repositoryId, user), null); } /// diff --git a/Octokit/Clients/RepositoriesClient.cs b/Octokit/Clients/RepositoriesClient.cs index 4d4bfe3bad..23db23bde0 100644 --- a/Octokit/Clients/RepositoriesClient.cs +++ b/Octokit/Clients/RepositoriesClient.cs @@ -50,7 +50,6 @@ public RepositoriesClient(IApiConnection apiConnection) : base(apiConnection) /// A instance describing the new repository to create /// Thrown when a general API error occurs. /// A instance for the created repository. - [Preview("nebula")] [ManualRoute("POST", "/user/repos")] public Task Create(NewRepository newRepository) { @@ -69,8 +68,6 @@ public Task Create(NewRepository newRepository) /// A instance describing the new repository to create /// Thrown when a general API error occurs. /// A instance for the created repository - [Preview("nebula")] - [Preview("baptiste")] [ManualRoute("POST", "/orgs/{org}/repos")] public Task Create(string organizationLogin, NewRepository newRepository) { @@ -89,7 +86,6 @@ public Task Create(string organizationLogin, NewRepository newReposi /// The name of template repository to work from /// /// - [Preview("baptiste")] [ManualRoute("POST", "/repos/{owner}/{repo}/generate")] public Task Generate(string templateOwner, string templateRepo, NewRepositoryFromTemplate newRepository) { @@ -99,14 +95,14 @@ public Task Generate(string templateOwner, string templateRepo, NewR if (string.IsNullOrEmpty(newRepository.Name)) throw new ArgumentException("The new repository's name must not be null."); - return ApiConnection.Post(ApiUrls.Repositories(templateOwner, templateRepo), newRepository, AcceptHeaders.TemplatePreview); + return ApiConnection.Post(ApiUrls.Repositories(templateOwner, templateRepo), newRepository); } async Task Create(Uri url, string organizationLogin, NewRepository newRepository) { try { - return await ApiConnection.Post(url, newRepository, AcceptHeaders.Concat(AcceptHeaders.VisibilityPreview, AcceptHeaders.TemplatePreview)).ConfigureAwait(false); + return await ApiConnection.Post(url, newRepository).ConfigureAwait(false); } catch (ApiValidationException e) { @@ -200,7 +196,6 @@ public Task Delete(long repositoryId) /// The name of the repository /// Repository transfer information /// A - [Preview("mercy")] [ManualRoute("POST", "/repos/{owner}/{repo}/transfer")] public Task Transfer(string owner, string name, RepositoryTransfer repositoryTransfer) { @@ -220,7 +215,6 @@ public Task Transfer(string owner, string name, RepositoryTransfer r /// The id of the repository /// Repository transfer information /// A - [Preview("mercy")] [ManualRoute("POST", "/repositories/{id}/transfer")] public Task Transfer(long repositoryId, RepositoryTransfer repositoryTransfer) { @@ -262,8 +256,6 @@ public async Task AreVulnerabilityAlertsEnabled(string owner, string name) /// The name of the repository /// New values to update the repository with /// The updated - [Preview("nebula")] - [Preview("baptiste")] [ManualRoute("PATCH", "/repos/{owner}/{repo}")] public Task Edit(string owner, string name, RepositoryUpdate update) { @@ -271,7 +263,7 @@ public Task Edit(string owner, string name, RepositoryUpdate update) Ensure.ArgumentNotNullOrEmptyString(name, nameof(name)); Ensure.ArgumentNotNull(update, nameof(update)); - return ApiConnection.Patch(ApiUrls.Repository(owner, name), update, AcceptHeaders.Concat(AcceptHeaders.VisibilityPreview, AcceptHeaders.TemplatePreview)); + return ApiConnection.Patch(ApiUrls.Repository(owner, name), update); } /// @@ -280,7 +272,6 @@ public Task Edit(string owner, string name, RepositoryUpdate update) /// The Id of the repository /// New values to update the repository with /// The updated - [Preview("mercy")] [ManualRoute("PATCH", "/repositories/{id}")] public Task Edit(long repositoryId, RepositoryUpdate update) { @@ -299,14 +290,13 @@ public Task Edit(long repositoryId, RepositoryUpdate update) /// The name of the repository /// Thrown when a general API error occurs. /// A - [Preview("nebula")] [ManualRoute("GET", "/repos/{owner}/{repo}")] public Task Get(string owner, string name) { Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner)); Ensure.ArgumentNotNullOrEmptyString(name, nameof(name)); - return ApiConnection.Get(ApiUrls.Repository(owner, name), null, AcceptHeaders.VisibilityPreview); + return ApiConnection.Get(ApiUrls.Repository(owner, name), null); } /// @@ -318,7 +308,6 @@ public Task Get(string owner, string name) /// The Id of the repository /// Thrown when a general API error occurs. /// A - [Preview("mercy")] [ManualRoute("GET", "/repositories/{id}")] public Task Get(long repositoryId) { @@ -372,8 +361,6 @@ public Task> GetAllPublic(PublicRepositoryRequest requ /// Thrown if the client is not authenticated. /// Thrown when a general API error occurs. /// A of . - [Preview("nebula")] - [Preview("baptiste")] [ManualRoute("GET", "/user/repos")] public Task> GetAllForCurrent() { @@ -390,14 +377,12 @@ public Task> GetAllForCurrent() /// Thrown if the client is not authenticated. /// Thrown when a general API error occurs. /// A of . - [Preview("nebula")] - [Preview("baptiste")] [ManualRoute("GET", "/user/repos")] public Task> GetAllForCurrent(ApiOptions options) { Ensure.ArgumentNotNull(options, nameof(options)); - return ApiConnection.GetAll(ApiUrls.Repositories(), null, AcceptHeaders.Concat(AcceptHeaders.VisibilityPreview, AcceptHeaders.TemplatePreview), options); + return ApiConnection.GetAll(ApiUrls.Repositories(), null, options); } /// @@ -411,7 +396,6 @@ public Task> GetAllForCurrent(ApiOptions options) /// Thrown if the client is not authenticated. /// Thrown when a general API error occurs. /// A of . - [Preview("nebula")] [ManualRoute("GET", "/user/repos")] public Task> GetAllForCurrent(RepositoryRequest request) { @@ -432,14 +416,13 @@ public Task> GetAllForCurrent(RepositoryRequest reques /// Thrown if the client is not authenticated. /// Thrown when a general API error occurs. /// A of . - [Preview("nebula")] [ManualRoute("GET", "/user/repos")] public Task> GetAllForCurrent(RepositoryRequest request, ApiOptions options) { Ensure.ArgumentNotNull(request, nameof(request)); Ensure.ArgumentNotNull(options, nameof(options)); - return ApiConnection.GetAll(ApiUrls.Repositories(), request.ToParametersDictionary(), AcceptHeaders.VisibilityPreview, options); + return ApiConnection.GetAll(ApiUrls.Repositories(), request.ToParametersDictionary(), options); } /// @@ -488,8 +471,6 @@ public Task> GetAllForUser(string login, ApiOptions op /// /// Thrown when a general API error occurs. /// A of . - [Preview("nebula")] - [Preview("baptiste")] [ManualRoute("GET", "/orgs/{org}/repos")] public Task> GetAllForOrg(string organization) { @@ -508,15 +489,13 @@ public Task> GetAllForOrg(string organization) /// Options for changing the API response /// Thrown when a general API error occurs. /// A of . - [Preview("nebula")] - [Preview("baptiste")] [ManualRoute("GET", "/orgs/{org}/repos")] public Task> GetAllForOrg(string organization, ApiOptions options) { Ensure.ArgumentNotNullOrEmptyString(organization, nameof(organization)); Ensure.ArgumentNotNull(options, nameof(options)); - return ApiConnection.GetAll(ApiUrls.OrganizationRepositories(organization), null, AcceptHeaders.Concat(AcceptHeaders.VisibilityPreview, AcceptHeaders.TemplatePreview), options); + return ApiConnection.GetAll(ApiUrls.OrganizationRepositories(organization), null, options); } /// @@ -796,7 +775,7 @@ public async Task GetAllTopics(long repositoryId, ApiOptions o { Ensure.ArgumentNotNull(options, nameof(options)); var endpoint = ApiUrls.RepositoryTopics(repositoryId); - var data = await ApiConnection.Get(endpoint, null, AcceptHeaders.RepositoryTopicsPreview).ConfigureAwait(false); + var data = await ApiConnection.Get(endpoint, null).ConfigureAwait(false); return data ?? new RepositoryTopics(); } @@ -834,7 +813,7 @@ public async Task GetAllTopics(string owner, string name, ApiO Ensure.ArgumentNotNull(options, nameof(options)); var endpoint = ApiUrls.RepositoryTopics(owner, name); - var data = await ApiConnection.Get(endpoint, null, AcceptHeaders.RepositoryTopicsPreview).ConfigureAwait(false); + var data = await ApiConnection.Get(endpoint, null).ConfigureAwait(false); return data ?? new RepositoryTopics(); } @@ -875,7 +854,7 @@ public async Task ReplaceAllTopics(string owner, string name, Ensure.ArgumentNotNull(topics, nameof(topics)); var endpoint = ApiUrls.RepositoryTopics(owner, name); - var data = await ApiConnection.Put(endpoint, topics, null, AcceptHeaders.RepositoryTopicsPreview).ConfigureAwait(false); + var data = await ApiConnection.Put(endpoint, topics, null).ConfigureAwait(false); return data ?? new RepositoryTopics(); } @@ -897,7 +876,7 @@ public async Task ReplaceAllTopics(long repositoryId, Reposito Ensure.ArgumentNotNull(topics, nameof(topics)); var endpoint = ApiUrls.RepositoryTopics(repositoryId); - var data = await ApiConnection.Put(endpoint, topics, null, AcceptHeaders.RepositoryTopicsPreview).ConfigureAwait(false); + var data = await ApiConnection.Put(endpoint, topics, null).ConfigureAwait(false); return data ?? new RepositoryTopics(); } diff --git a/Octokit/Clients/RepositoryBranchesClient.cs b/Octokit/Clients/RepositoryBranchesClient.cs index 87944a2822..2e457a0b7e 100644 --- a/Octokit/Clients/RepositoryBranchesClient.cs +++ b/Octokit/Clients/RepositoryBranchesClient.cs @@ -1,5 +1,4 @@ -using System; -using System.Collections.Generic; +using System.Collections.Generic; using System.Net; using System.Threading.Tasks; @@ -62,7 +61,6 @@ public Task> GetAll(long repositoryId) /// The name of the repository /// Options for changing the API response /// Thrown when a general API error occurs. - [Preview("luke-cage")] [ManualRoute("GET", "/repos/{owner}/{repo}/branches")] public Task> GetAll(string owner, string name, ApiOptions options) { @@ -70,7 +68,7 @@ public Task> GetAll(string owner, string name, ApiOptions Ensure.ArgumentNotNullOrEmptyString(name, nameof(name)); Ensure.ArgumentNotNull(options, nameof(options)); - return ApiConnection.GetAll(ApiUrls.RepoBranches(owner, name), null, AcceptHeaders.ProtectedBranchesRequiredApprovingApiPreview, options); + return ApiConnection.GetAll(ApiUrls.RepoBranches(owner, name), null, options); } /// @@ -81,13 +79,12 @@ public Task> GetAll(string owner, string name, ApiOptions /// /// The Id of the repository /// Options for changing the API response - [Preview("luke-cage")] [ManualRoute("GET", "/repositories/{id}/branches")] public Task> GetAll(long repositoryId, ApiOptions options) { Ensure.ArgumentNotNull(options, nameof(options)); - return ApiConnection.GetAll(ApiUrls.RepoBranches(repositoryId), null, AcceptHeaders.ProtectedBranchesRequiredApprovingApiPreview, options); + return ApiConnection.GetAll(ApiUrls.RepoBranches(repositoryId), null, options); } /// @@ -99,7 +96,6 @@ public Task> GetAll(long repositoryId, ApiOptions options) /// The owner of the repository /// The name of the repository /// The name of the branch - [Preview("luke-cage")] [ManualRoute("GET", "/repos/{owner}/{repo}/branches/{branch}")] public Task Get(string owner, string name, string branch) { @@ -107,7 +103,7 @@ public Task Get(string owner, string name, string branch) Ensure.ArgumentNotNullOrEmptyString(name, nameof(name)); Ensure.ArgumentNotNullOrEmptyString(branch, nameof(branch)); - return ApiConnection.Get(ApiUrls.RepoBranch(owner, name, branch), null, AcceptHeaders.ProtectedBranchesRequiredApprovingApiPreview); + return ApiConnection.Get(ApiUrls.RepoBranch(owner, name, branch), null); } /// @@ -118,13 +114,12 @@ public Task Get(string owner, string name, string branch) /// /// The Id of the repository /// The name of the branch - [Preview("luke-cage")] [ManualRoute("GET", "/repositories/{id}/branches/{branch}")] public Task Get(long repositoryId, string branch) { Ensure.ArgumentNotNullOrEmptyString(branch, nameof(branch)); - return ApiConnection.Get(ApiUrls.RepoBranch(repositoryId, branch), null, AcceptHeaders.ProtectedBranchesRequiredApprovingApiPreview); + return ApiConnection.Get(ApiUrls.RepoBranch(repositoryId, branch), null); } /// @@ -136,7 +131,6 @@ public Task Get(long repositoryId, string branch) /// The owner of the repository /// The name of the repository /// The name of the branch - [Preview("luke-cage")] [ManualRoute("GET", "/repos/{owner}/{repo}/branches/{branch}/protection")] public Task GetBranchProtection(string owner, string name, string branch) { @@ -144,7 +138,7 @@ public Task GetBranchProtection(string owner, string n Ensure.ArgumentNotNullOrEmptyString(name, nameof(name)); Ensure.ArgumentNotNullOrEmptyString(branch, nameof(branch)); - return ApiConnection.Get(ApiUrls.RepoBranchProtection(owner, name, branch), null, AcceptHeaders.ProtectedBranchesRequiredApprovingApiPreview); + return ApiConnection.Get(ApiUrls.RepoBranchProtection(owner, name, branch), null); } /// @@ -155,13 +149,12 @@ public Task GetBranchProtection(string owner, string n /// /// The Id of the repository /// The name of the branch - [Preview("luke-cage")] [ManualRoute("GET", "/repositories/{id}/branches/{branch}/protection")] public Task GetBranchProtection(long repositoryId, string branch) { Ensure.ArgumentNotNullOrEmptyString(branch, nameof(branch)); - return ApiConnection.Get(ApiUrls.RepoBranchProtection(repositoryId, branch), null, AcceptHeaders.ProtectedBranchesRequiredApprovingApiPreview); + return ApiConnection.Get(ApiUrls.RepoBranchProtection(repositoryId, branch), null); } /// @@ -174,7 +167,6 @@ public Task GetBranchProtection(long repositoryId, str /// The name of the repository /// The name of the branch /// Branch protection settings - [Preview("luke-cage")] [ManualRoute("PUT", "/repos/{owner}/{repo}/branches/{branch}/protection")] public Task UpdateBranchProtection(string owner, string name, string branch, BranchProtectionSettingsUpdate update) { @@ -183,7 +175,7 @@ public Task UpdateBranchProtection(string owner, strin Ensure.ArgumentNotNullOrEmptyString(branch, nameof(branch)); Ensure.ArgumentNotNull(update, nameof(update)); - return ApiConnection.Put(ApiUrls.RepoBranchProtection(owner, name, branch), update, null, AcceptHeaders.ProtectedBranchesRequiredApprovingApiPreview); + return ApiConnection.Put(ApiUrls.RepoBranchProtection(owner, name, branch), update, null); } /// @@ -195,14 +187,13 @@ public Task UpdateBranchProtection(string owner, strin /// The Id of the repository /// The name of the branch /// Branch protection settings - [Preview("luke-cage")] [ManualRoute("PUT", "/repositories/{id}/branches/{branch}/protection")] public Task UpdateBranchProtection(long repositoryId, string branch, BranchProtectionSettingsUpdate update) { Ensure.ArgumentNotNullOrEmptyString(branch, nameof(branch)); Ensure.ArgumentNotNull(update, nameof(update)); - return ApiConnection.Put(ApiUrls.RepoBranchProtection(repositoryId, branch), update, null, AcceptHeaders.ProtectedBranchesRequiredApprovingApiPreview); + return ApiConnection.Put(ApiUrls.RepoBranchProtection(repositoryId, branch), update, null); } /// @@ -214,7 +205,6 @@ public Task UpdateBranchProtection(long repositoryId, /// The owner of the repository /// The name of the repository /// The name of the branch - [Preview("luke-cage")] [ManualRoute("DELETE", "/repos/{owner}/{repo}/branches/{branch}/protection")] public async Task DeleteBranchProtection(string owner, string name, string branch) { @@ -225,7 +215,7 @@ public async Task DeleteBranchProtection(string owner, string name, string var endpoint = ApiUrls.RepoBranchProtection(owner, name, branch); try { - var httpStatusCode = await Connection.Delete(endpoint, null, AcceptHeaders.ProtectedBranchesRequiredApprovingApiPreview).ConfigureAwait(false); + var httpStatusCode = await Connection.Delete(endpoint, null).ConfigureAwait(false); return httpStatusCode == HttpStatusCode.NoContent; } catch (NotFoundException) @@ -242,7 +232,6 @@ public async Task DeleteBranchProtection(string owner, string name, string /// /// The Id of the repository /// The name of the branch - [Preview("luke-cage")] [ManualRoute("DELETE", "/repositories/{id}/branches/{branch}/protection")] public async Task DeleteBranchProtection(long repositoryId, string branch) { @@ -251,7 +240,7 @@ public async Task DeleteBranchProtection(long repositoryId, string branch) var endpoint = ApiUrls.RepoBranchProtection(repositoryId, branch); try { - var httpStatusCode = await Connection.Delete(endpoint, null, AcceptHeaders.ProtectedBranchesRequiredApprovingApiPreview).ConfigureAwait(false); + var httpStatusCode = await Connection.Delete(endpoint, null).ConfigureAwait(false); return httpStatusCode == HttpStatusCode.NoContent; } catch (NotFoundException) @@ -269,7 +258,6 @@ public async Task DeleteBranchProtection(long repositoryId, string branch) /// The owner of the repository /// The name of the repository /// The name of the branch - [Preview("luke-cage")] [ManualRoute("GET", "/repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks")] public Task GetRequiredStatusChecks(string owner, string name, string branch) { @@ -277,7 +265,7 @@ public Task GetRequiredStatusChecks(string Ensure.ArgumentNotNullOrEmptyString(name, nameof(name)); Ensure.ArgumentNotNullOrEmptyString(branch, nameof(branch)); - return ApiConnection.Get(ApiUrls.RepoRequiredStatusChecks(owner, name, branch), null, AcceptHeaders.ProtectedBranchesRequiredApprovingApiPreview); + return ApiConnection.Get(ApiUrls.RepoRequiredStatusChecks(owner, name, branch), null); } /// @@ -288,13 +276,12 @@ public Task GetRequiredStatusChecks(string /// /// The Id of the repository /// The name of the branch - [Preview("luke-cage")] [ManualRoute("GET", "/repositories/{id}/branches/{branch}/protection/required_status_checks")] public Task GetRequiredStatusChecks(long repositoryId, string branch) { Ensure.ArgumentNotNullOrEmptyString(branch, nameof(branch)); - return ApiConnection.Get(ApiUrls.RepoRequiredStatusChecks(repositoryId, branch), null, AcceptHeaders.ProtectedBranchesRequiredApprovingApiPreview); + return ApiConnection.Get(ApiUrls.RepoRequiredStatusChecks(repositoryId, branch), null); } /// @@ -307,7 +294,6 @@ public Task GetRequiredStatusChecks(long r /// The name of the repository /// The name of the branch /// Required status checks - [Preview("luke-cage")] [ManualRoute("PATCH", "/repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks")] public Task UpdateRequiredStatusChecks(string owner, string name, string branch, BranchProtectionRequiredStatusChecksUpdate update) { @@ -316,7 +302,7 @@ public Task UpdateRequiredStatusChecks(str Ensure.ArgumentNotNullOrEmptyString(branch, nameof(branch)); Ensure.ArgumentNotNull(update, nameof(update)); - return ApiConnection.Patch(ApiUrls.RepoRequiredStatusChecks(owner, name, branch), update, AcceptHeaders.ProtectedBranchesRequiredApprovingApiPreview); + return ApiConnection.Patch(ApiUrls.RepoRequiredStatusChecks(owner, name, branch), update); } /// @@ -328,14 +314,13 @@ public Task UpdateRequiredStatusChecks(str /// The Id of the repository /// The name of the branch /// Required status checks - [Preview("luke-cage")] [ManualRoute("PATCH", "/repositories/{id}/branches/{branch}/protection/required_status_checks")] public Task UpdateRequiredStatusChecks(long repositoryId, string branch, BranchProtectionRequiredStatusChecksUpdate update) { Ensure.ArgumentNotNullOrEmptyString(branch, nameof(branch)); Ensure.ArgumentNotNull(update, nameof(update)); - return ApiConnection.Patch(ApiUrls.RepoRequiredStatusChecks(repositoryId, branch), update, AcceptHeaders.ProtectedBranchesRequiredApprovingApiPreview); + return ApiConnection.Patch(ApiUrls.RepoRequiredStatusChecks(repositoryId, branch), update); } /// @@ -347,7 +332,6 @@ public Task UpdateRequiredStatusChecks(lon /// The owner of the repository /// The name of the repository /// The name of the branch - [Preview("luke-cage")] [ManualRoute("DELETE", "/repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks")] public async Task DeleteRequiredStatusChecks(string owner, string name, string branch) { @@ -359,7 +343,7 @@ public async Task DeleteRequiredStatusChecks(string owner, string name, st try { - var httpStatusCode = await Connection.Delete(endpoint, null, AcceptHeaders.ProtectedBranchesRequiredApprovingApiPreview).ConfigureAwait(false); + var httpStatusCode = await Connection.Delete(endpoint, null).ConfigureAwait(false); return httpStatusCode == HttpStatusCode.NoContent; } catch (NotFoundException) @@ -376,7 +360,6 @@ public async Task DeleteRequiredStatusChecks(string owner, string name, st /// /// The Id of the repository /// The name of the branch - [Preview("luke-cage")] [ManualRoute("DELETE", "/repositories/{id}/branches/{branch}/protection/required_status_checks")] public async Task DeleteRequiredStatusChecks(long repositoryId, string branch) { @@ -386,7 +369,7 @@ public async Task DeleteRequiredStatusChecks(long repositoryId, string bra try { - var httpStatusCode = await Connection.Delete(endpoint, null, AcceptHeaders.ProtectedBranchesRequiredApprovingApiPreview).ConfigureAwait(false); + var httpStatusCode = await Connection.Delete(endpoint, null).ConfigureAwait(false); return httpStatusCode == HttpStatusCode.NoContent; } catch (NotFoundException) @@ -404,7 +387,6 @@ public async Task DeleteRequiredStatusChecks(long repositoryId, string bra /// The owner of the repository /// The name of the repository /// The name of the branch - [Preview("luke-cage")] [ManualRoute("GET", "/repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts")] public Task> GetAllRequiredStatusChecksContexts(string owner, string name, string branch) { @@ -412,7 +394,7 @@ public Task> GetAllRequiredStatusChecksContexts(string own Ensure.ArgumentNotNullOrEmptyString(name, nameof(name)); Ensure.ArgumentNotNullOrEmptyString(branch, nameof(branch)); - return ApiConnection.Get>(ApiUrls.RepoRequiredStatusChecksContexts(owner, name, branch), null, AcceptHeaders.ProtectedBranchesRequiredApprovingApiPreview); + return ApiConnection.Get>(ApiUrls.RepoRequiredStatusChecksContexts(owner, name, branch), null); } /// @@ -423,13 +405,12 @@ public Task> GetAllRequiredStatusChecksContexts(string own /// /// The Id of the repository /// The name of the branch - [Preview("luke-cage")] [ManualRoute("GET", "/repositories/{id}/branches/{branch}/protection/required_status_checks/contexts")] public Task> GetAllRequiredStatusChecksContexts(long repositoryId, string branch) { Ensure.ArgumentNotNullOrEmptyString(branch, nameof(branch)); - return ApiConnection.Get>(ApiUrls.RepoRequiredStatusChecksContexts(repositoryId, branch), null, AcceptHeaders.ProtectedBranchesRequiredApprovingApiPreview); + return ApiConnection.Get>(ApiUrls.RepoRequiredStatusChecksContexts(repositoryId, branch), null); } /// @@ -442,7 +423,6 @@ public Task> GetAllRequiredStatusChecksContexts(long repos /// The name of the repository /// The name of the branch /// The contexts to replace - [Preview("luke-cage")] [ManualRoute("PUT", "/repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts")] public Task> UpdateRequiredStatusChecksContexts(string owner, string name, string branch, IReadOnlyList contexts) { @@ -451,7 +431,7 @@ public Task> UpdateRequiredStatusChecksContexts(string own Ensure.ArgumentNotNullOrEmptyString(branch, nameof(branch)); Ensure.ArgumentNotNull(contexts, nameof(contexts)); - return ApiConnection.Put>(ApiUrls.RepoRequiredStatusChecksContexts(owner, name, branch), contexts, null, AcceptHeaders.ProtectedBranchesRequiredApprovingApiPreview); + return ApiConnection.Put>(ApiUrls.RepoRequiredStatusChecksContexts(owner, name, branch), contexts, null); } /// @@ -463,14 +443,13 @@ public Task> UpdateRequiredStatusChecksContexts(string own /// The Id of the repository /// The name of the branch /// The contexts to replace - [Preview("luke-cage")] [ManualRoute("PUT", "/repositories/{id}/branches/{branch}/protection/required_status_checks/contexts")] public Task> UpdateRequiredStatusChecksContexts(long repositoryId, string branch, IReadOnlyList contexts) { Ensure.ArgumentNotNullOrEmptyString(branch, nameof(branch)); Ensure.ArgumentNotNull(contexts, nameof(contexts)); - return ApiConnection.Put>(ApiUrls.RepoRequiredStatusChecksContexts(repositoryId, branch), contexts, null, AcceptHeaders.ProtectedBranchesRequiredApprovingApiPreview); + return ApiConnection.Put>(ApiUrls.RepoRequiredStatusChecksContexts(repositoryId, branch), contexts, null); } /// @@ -483,7 +462,6 @@ public Task> UpdateRequiredStatusChecksContexts(long repos /// The name of the repository /// The name of the branch /// The contexts to add - [Preview("luke-cage")] [ManualRoute("POST", "/repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts")] public Task> AddRequiredStatusChecksContexts(string owner, string name, string branch, IReadOnlyList contexts) { @@ -492,7 +470,7 @@ public Task> AddRequiredStatusChecksContexts(string owner, Ensure.ArgumentNotNullOrEmptyString(branch, nameof(branch)); Ensure.ArgumentNotNull(contexts, nameof(contexts)); - return ApiConnection.Post>(ApiUrls.RepoRequiredStatusChecksContexts(owner, name, branch), contexts, AcceptHeaders.ProtectedBranchesRequiredApprovingApiPreview); + return ApiConnection.Post>(ApiUrls.RepoRequiredStatusChecksContexts(owner, name, branch), contexts); } /// @@ -504,14 +482,13 @@ public Task> AddRequiredStatusChecksContexts(string owner, /// The Id of the repository /// The name of the branch /// The contexts to add - [Preview("luke-cage")] [ManualRoute("POST", "/repositories/{id}/branches/{branch}/protection/required_status_checks/contexts")] public Task> AddRequiredStatusChecksContexts(long repositoryId, string branch, IReadOnlyList contexts) { Ensure.ArgumentNotNullOrEmptyString(branch, nameof(branch)); Ensure.ArgumentNotNull(contexts, nameof(contexts)); - return ApiConnection.Post>(ApiUrls.RepoRequiredStatusChecksContexts(repositoryId, branch), contexts, AcceptHeaders.ProtectedBranchesRequiredApprovingApiPreview); + return ApiConnection.Post>(ApiUrls.RepoRequiredStatusChecksContexts(repositoryId, branch), contexts); } /// @@ -524,7 +501,6 @@ public Task> AddRequiredStatusChecksContexts(long reposito /// The name of the repository /// The name of the branch /// The contexts to remove - [Preview("luke-cage")] [ManualRoute("DELETE", "/repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts")] public Task> DeleteRequiredStatusChecksContexts(string owner, string name, string branch, IReadOnlyList contexts) { @@ -533,7 +509,7 @@ public Task> DeleteRequiredStatusChecksContexts(string own Ensure.ArgumentNotNullOrEmptyString(branch, nameof(branch)); Ensure.ArgumentNotNull(contexts, nameof(contexts)); - return ApiConnection.Delete>(ApiUrls.RepoRequiredStatusChecksContexts(owner, name, branch), contexts, AcceptHeaders.ProtectedBranchesRequiredApprovingApiPreview); + return ApiConnection.Delete>(ApiUrls.RepoRequiredStatusChecksContexts(owner, name, branch), contexts); } /// @@ -545,14 +521,13 @@ public Task> DeleteRequiredStatusChecksContexts(string own /// The Id of the repository /// The name of the branch /// The contexts to remove - [Preview("luke-cage")] [ManualRoute("DELETE", "/repositories/{id}/branches/{branch}/protection/required_status_checks/contexts")] public Task> DeleteRequiredStatusChecksContexts(long repositoryId, string branch, IReadOnlyList contexts) { Ensure.ArgumentNotNullOrEmptyString(branch, nameof(branch)); Ensure.ArgumentNotNull(contexts, nameof(contexts)); - return ApiConnection.Delete>(ApiUrls.RepoRequiredStatusChecksContexts(repositoryId, branch), contexts, AcceptHeaders.ProtectedBranchesRequiredApprovingApiPreview); + return ApiConnection.Delete>(ApiUrls.RepoRequiredStatusChecksContexts(repositoryId, branch), contexts); } /// @@ -564,7 +539,6 @@ public Task> DeleteRequiredStatusChecksContexts(long repos /// The owner of the repository /// The name of the repository /// The name of the branch - [Preview("luke-cage")] [ManualRoute("GET", "/repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews")] public Task GetReviewEnforcement(string owner, string name, string branch) { @@ -572,7 +546,7 @@ public Task GetReviewEnforcement(string owner, Ensure.ArgumentNotNullOrEmptyString(name, nameof(name)); Ensure.ArgumentNotNullOrEmptyString(branch, nameof(branch)); - return ApiConnection.Get(ApiUrls.RepoProtectedBranchReviewEnforcement(owner, name, branch), null, AcceptHeaders.ProtectedBranchesRequiredApprovingApiPreview); + return ApiConnection.Get(ApiUrls.RepoProtectedBranchReviewEnforcement(owner, name, branch), null); } /// @@ -583,13 +557,12 @@ public Task GetReviewEnforcement(string owner, /// /// The Id of the repository /// The name of the branch - [Preview("luke-cage")] [ManualRoute("GET", "/repositories/{id}/branches/{branch}/protection/required_pull_request_reviews")] public Task GetReviewEnforcement(long repositoryId, string branch) { Ensure.ArgumentNotNullOrEmptyString(branch, nameof(branch)); - return ApiConnection.Get(ApiUrls.RepoProtectedBranchReviewEnforcement(repositoryId, branch), null, AcceptHeaders.ProtectedBranchesRequiredApprovingApiPreview); + return ApiConnection.Get(ApiUrls.RepoProtectedBranchReviewEnforcement(repositoryId, branch), null); } /// @@ -602,7 +575,6 @@ public Task GetReviewEnforcement(long repositor /// The name of the repository /// The name of the branch /// The required pull request review settings - [Preview("luke-cage")] [ManualRoute("PATCH", "/repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews")] public Task UpdateReviewEnforcement(string owner, string name, string branch, BranchProtectionRequiredReviewsUpdate update) { @@ -611,7 +583,7 @@ public Task UpdateReviewEnforcement(string owne Ensure.ArgumentNotNullOrEmptyString(branch, nameof(branch)); Ensure.ArgumentNotNull(update, nameof(update)); - return ApiConnection.Patch(ApiUrls.RepoProtectedBranchReviewEnforcement(owner, name, branch), update, AcceptHeaders.ProtectedBranchesRequiredApprovingApiPreview); + return ApiConnection.Patch(ApiUrls.RepoProtectedBranchReviewEnforcement(owner, name, branch), update); } /// @@ -623,14 +595,13 @@ public Task UpdateReviewEnforcement(string owne /// The Id of the repository /// The name of the branch /// The required pull request review settings - [Preview("luke-cage")] [ManualRoute("GET", "/repositories/{id}/branches/{branch}/protection/required_pull_request_reviews")] public Task UpdateReviewEnforcement(long repositoryId, string branch, BranchProtectionRequiredReviewsUpdate update) { Ensure.ArgumentNotNullOrEmptyString(branch, nameof(branch)); Ensure.ArgumentNotNull(update, nameof(update)); - return ApiConnection.Patch(ApiUrls.RepoProtectedBranchReviewEnforcement(repositoryId, branch), update, AcceptHeaders.ProtectedBranchesRequiredApprovingApiPreview); + return ApiConnection.Patch(ApiUrls.RepoProtectedBranchReviewEnforcement(repositoryId, branch), update); } /// @@ -642,7 +613,6 @@ public Task UpdateReviewEnforcement(long reposi /// The owner of the repository /// The name of the repository /// The name of the branch - [Preview("luke-cage")] [ManualRoute("DELETE", "/repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews")] public async Task RemoveReviewEnforcement(string owner, string name, string branch) { @@ -654,7 +624,7 @@ public async Task RemoveReviewEnforcement(string owner, string name, strin try { - var httpStatusCode = await Connection.Delete(endpoint, null, AcceptHeaders.ProtectedBranchesRequiredApprovingApiPreview).ConfigureAwait(false); + var httpStatusCode = await Connection.Delete(endpoint, null).ConfigureAwait(false); return httpStatusCode == HttpStatusCode.NoContent; } catch (NotFoundException) @@ -671,7 +641,6 @@ public async Task RemoveReviewEnforcement(string owner, string name, strin /// /// The Id of the repository /// The name of the branch - [Preview("luke-cage")] [ManualRoute("DELETE", "/repositories/{id}/branches/{branch}/protection/required_pull_request_reviews")] public async Task RemoveReviewEnforcement(long repositoryId, string branch) { @@ -681,7 +650,7 @@ public async Task RemoveReviewEnforcement(long repositoryId, string branch try { - var httpStatusCode = await Connection.Delete(endpoint, null, AcceptHeaders.ProtectedBranchesRequiredApprovingApiPreview).ConfigureAwait(false); + var httpStatusCode = await Connection.Delete(endpoint, null).ConfigureAwait(false); return httpStatusCode == HttpStatusCode.NoContent; } catch (NotFoundException) @@ -699,7 +668,6 @@ public async Task RemoveReviewEnforcement(long repositoryId, string branch /// The owner of the repository /// The name of the repository /// The name of the branch - [Preview("luke-cage")] [ManualRoute("GET", "/repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins")] public Task GetAdminEnforcement(string owner, string name, string branch) { @@ -707,7 +675,7 @@ public Task GetAdminEnforcement(string owner, string name, string Ensure.ArgumentNotNullOrEmptyString(name, nameof(name)); Ensure.ArgumentNotNullOrEmptyString(branch, nameof(branch)); - return ApiConnection.Get(ApiUrls.RepoProtectedBranchAdminEnforcement(owner, name, branch), null, AcceptHeaders.ProtectedBranchesRequiredApprovingApiPreview); + return ApiConnection.Get(ApiUrls.RepoProtectedBranchAdminEnforcement(owner, name, branch), null); } /// @@ -718,13 +686,12 @@ public Task GetAdminEnforcement(string owner, string name, string /// /// The Id of the repository /// The name of the branch - [Preview("luke-cage")] [ManualRoute("GET", "/repositories/{id}/branches/{branch}/protection/enforce_admins")] public Task GetAdminEnforcement(long repositoryId, string branch) { Ensure.ArgumentNotNullOrEmptyString(branch, nameof(branch)); - return ApiConnection.Get(ApiUrls.RepoProtectedBranchAdminEnforcement(repositoryId, branch), null, AcceptHeaders.ProtectedBranchesRequiredApprovingApiPreview); + return ApiConnection.Get(ApiUrls.RepoProtectedBranchAdminEnforcement(repositoryId, branch), null); } /// @@ -736,7 +703,6 @@ public Task GetAdminEnforcement(long repositoryId, string branch) /// The owner of the repository /// The name of the repository /// The name of the branch - [Preview("luke-cage")] [ManualRoute("POST", "/repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins")] public Task AddAdminEnforcement(string owner, string name, string branch) { @@ -744,7 +710,7 @@ public Task AddAdminEnforcement(string owner, string name, string Ensure.ArgumentNotNullOrEmptyString(name, nameof(name)); Ensure.ArgumentNotNullOrEmptyString(branch, nameof(branch)); - return ApiConnection.Post(ApiUrls.RepoProtectedBranchAdminEnforcement(owner, name, branch), new object(), AcceptHeaders.ProtectedBranchesRequiredApprovingApiPreview); + return ApiConnection.Post(ApiUrls.RepoProtectedBranchAdminEnforcement(owner, name, branch), new object()); } /// @@ -755,13 +721,12 @@ public Task AddAdminEnforcement(string owner, string name, string /// /// The Id of the repository /// The name of the branch - [Preview("luke-cage")] [ManualRoute("POST", "/repositories/{id}/branches/{branch}/protection/enforce_admins")] public Task AddAdminEnforcement(long repositoryId, string branch) { Ensure.ArgumentNotNullOrEmptyString(branch, nameof(branch)); - return ApiConnection.Post(ApiUrls.RepoProtectedBranchAdminEnforcement(repositoryId, branch), new object(), AcceptHeaders.ProtectedBranchesRequiredApprovingApiPreview); + return ApiConnection.Post(ApiUrls.RepoProtectedBranchAdminEnforcement(repositoryId, branch), new object()); } /// @@ -773,7 +738,6 @@ public Task AddAdminEnforcement(long repositoryId, string branch) /// The owner of the repository /// The name of the repository /// The name of the branch - [Preview("luke-cage")] [ManualRoute("DELETE", "/repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins")] public async Task RemoveAdminEnforcement(string owner, string name, string branch) { @@ -785,7 +749,7 @@ public async Task RemoveAdminEnforcement(string owner, string name, string try { - var httpStatusCode = await Connection.Delete(endpoint, null, AcceptHeaders.ProtectedBranchesRequiredApprovingApiPreview).ConfigureAwait(false); + var httpStatusCode = await Connection.Delete(endpoint, null).ConfigureAwait(false); return httpStatusCode == HttpStatusCode.NoContent; } catch (NotFoundException) @@ -802,7 +766,6 @@ public async Task RemoveAdminEnforcement(string owner, string name, string /// /// The Id of the repository /// The name of the branch - [Preview("luke-cage")] [ManualRoute("DELETE", "/repositories/{id}/branches/{branch}/protection/enforce_admins")] public async Task RemoveAdminEnforcement(long repositoryId, string branch) { @@ -812,7 +775,7 @@ public async Task RemoveAdminEnforcement(long repositoryId, string branch) try { - var httpStatusCode = await Connection.Delete(endpoint, null, AcceptHeaders.ProtectedBranchesRequiredApprovingApiPreview).ConfigureAwait(false); + var httpStatusCode = await Connection.Delete(endpoint, null).ConfigureAwait(false); return httpStatusCode == HttpStatusCode.NoContent; } catch (NotFoundException) @@ -830,7 +793,6 @@ public async Task RemoveAdminEnforcement(long repositoryId, string branch) /// The owner of the repository /// The name of the repository /// The name of the branch - [Preview("luke-cage")] [ManualRoute("GET", "/repos/{owner}/{repo}/branches/{branch}/protection/restrictions")] public Task GetProtectedBranchRestrictions(string owner, string name, string branch) { @@ -838,7 +800,7 @@ public Task GetProtectedBranchRestrictions(str Ensure.ArgumentNotNullOrEmptyString(name, nameof(name)); Ensure.ArgumentNotNullOrEmptyString(branch, nameof(branch)); - return ApiConnection.Get(ApiUrls.RepoRestrictions(owner, name, branch), null, AcceptHeaders.ProtectedBranchesRequiredApprovingApiPreview); + return ApiConnection.Get(ApiUrls.RepoRestrictions(owner, name, branch), null); } /// @@ -849,13 +811,12 @@ public Task GetProtectedBranchRestrictions(str /// /// The Id of the repository /// The name of the branch - [Preview("luke-cage")] [ManualRoute("GET", "/repositories/{id}/branches/{branch}/protection/restrictions")] public Task GetProtectedBranchRestrictions(long repositoryId, string branch) { Ensure.ArgumentNotNullOrEmptyString(branch, nameof(branch)); - return ApiConnection.Get(ApiUrls.RepoRestrictions(repositoryId, branch), null, AcceptHeaders.ProtectedBranchesRequiredApprovingApiPreview); + return ApiConnection.Get(ApiUrls.RepoRestrictions(repositoryId, branch), null); } /// @@ -867,7 +828,6 @@ public Task GetProtectedBranchRestrictions(lon /// The owner of the repository /// The name of the repository /// The name of the branch - [Preview("luke-cage")] [ManualRoute("DELETE", "/repos/{owner}/{repo}/branches/{branch}/protection/restrictions")] public async Task DeleteProtectedBranchRestrictions(string owner, string name, string branch) { @@ -879,7 +839,7 @@ public async Task DeleteProtectedBranchRestrictions(string owner, string n try { - var httpStatusCode = await Connection.Delete(endpoint, null, AcceptHeaders.ProtectedBranchesRequiredApprovingApiPreview).ConfigureAwait(false); + var httpStatusCode = await Connection.Delete(endpoint, null).ConfigureAwait(false); return httpStatusCode == HttpStatusCode.NoContent; } catch (NotFoundException) @@ -896,7 +856,6 @@ public async Task DeleteProtectedBranchRestrictions(string owner, string n /// /// The Id of the repository /// The name of the branch - [Preview("luke-cage")] [ManualRoute("DELETE", "/repositories/{id}/branches/{branch}/protection/restrictions")] public async Task DeleteProtectedBranchRestrictions(long repositoryId, string branch) { @@ -906,7 +865,7 @@ public async Task DeleteProtectedBranchRestrictions(long repositoryId, str try { - var httpStatusCode = await Connection.Delete(endpoint, null, AcceptHeaders.ProtectedBranchesRequiredApprovingApiPreview).ConfigureAwait(false); + var httpStatusCode = await Connection.Delete(endpoint, null).ConfigureAwait(false); return httpStatusCode == HttpStatusCode.NoContent; } catch (NotFoundException) @@ -924,7 +883,6 @@ public async Task DeleteProtectedBranchRestrictions(long repositoryId, str /// The owner of the repository /// The name of the repository /// The name of the branch - [Preview("luke-cage")] [ManualRoute("GET", "/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams")] public Task> GetAllProtectedBranchTeamRestrictions(string owner, string name, string branch) { @@ -932,7 +890,7 @@ public Task> GetAllProtectedBranchTeamRestrictions(string ow Ensure.ArgumentNotNullOrEmptyString(name, nameof(name)); Ensure.ArgumentNotNullOrEmptyString(branch, nameof(branch)); - return ApiConnection.Get>(ApiUrls.RepoRestrictionsTeams(owner, name, branch), null, AcceptHeaders.ProtectedBranchesRequiredApprovingApiPreview); + return ApiConnection.Get>(ApiUrls.RepoRestrictionsTeams(owner, name, branch), null); } /// @@ -943,13 +901,12 @@ public Task> GetAllProtectedBranchTeamRestrictions(string ow /// /// The Id of the repository /// The name of the branch - [Preview("luke-cage")] [ManualRoute("GET", "/repositories/{id}/branches/{branch}/protection/restrictions/teams")] public Task> GetAllProtectedBranchTeamRestrictions(long repositoryId, string branch) { Ensure.ArgumentNotNullOrEmptyString(branch, nameof(branch)); - return ApiConnection.Get>(ApiUrls.RepoRestrictionsTeams(repositoryId, branch), null, AcceptHeaders.ProtectedBranchesRequiredApprovingApiPreview); + return ApiConnection.Get>(ApiUrls.RepoRestrictionsTeams(repositoryId, branch), null); } /// @@ -962,7 +919,6 @@ public Task> GetAllProtectedBranchTeamRestrictions(long repo /// The name of the repository /// The name of the branch /// List of teams with push access - [Preview("luke-cage")] [ManualRoute("PUT", "/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams")] public Task> UpdateProtectedBranchTeamRestrictions(string owner, string name, string branch, BranchProtectionTeamCollection teams) { @@ -971,7 +927,7 @@ public Task> UpdateProtectedBranchTeamRestrictions(string ow Ensure.ArgumentNotNullOrEmptyString(branch, nameof(branch)); Ensure.ArgumentNotNull(teams, nameof(teams)); - return ApiConnection.Put>(ApiUrls.RepoRestrictionsTeams(owner, name, branch), teams, null, AcceptHeaders.ProtectedBranchesRequiredApprovingApiPreview); + return ApiConnection.Put>(ApiUrls.RepoRestrictionsTeams(owner, name, branch), teams, null); } /// @@ -983,14 +939,13 @@ public Task> UpdateProtectedBranchTeamRestrictions(string ow /// The Id of the repository /// The name of the branch /// List of teams with push access - [Preview("luke-cage")] [ManualRoute("PUT", "/repositories/{id}/branches/{branch}/protection/restrictions/teams")] public Task> UpdateProtectedBranchTeamRestrictions(long repositoryId, string branch, BranchProtectionTeamCollection teams) { Ensure.ArgumentNotNullOrEmptyString(branch, nameof(branch)); Ensure.ArgumentNotNull(teams, nameof(teams)); - return ApiConnection.Put>(ApiUrls.RepoRestrictionsTeams(repositoryId, branch), teams, null, AcceptHeaders.ProtectedBranchesRequiredApprovingApiPreview); + return ApiConnection.Put>(ApiUrls.RepoRestrictionsTeams(repositoryId, branch), teams, null); } /// @@ -1003,7 +958,6 @@ public Task> UpdateProtectedBranchTeamRestrictions(long repo /// The name of the repository /// The name of the branch /// List of teams with push access to add - [Preview("luke-cage")] [ManualRoute("POST", "/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams")] public Task> AddProtectedBranchTeamRestrictions(string owner, string name, string branch, BranchProtectionTeamCollection teams) { @@ -1012,7 +966,7 @@ public Task> AddProtectedBranchTeamRestrictions(string owner Ensure.ArgumentNotNullOrEmptyString(branch, nameof(branch)); Ensure.ArgumentNotNull(teams, nameof(teams)); - return ApiConnection.Post>(ApiUrls.RepoRestrictionsTeams(owner, name, branch), teams, AcceptHeaders.ProtectedBranchesRequiredApprovingApiPreview); + return ApiConnection.Post>(ApiUrls.RepoRestrictionsTeams(owner, name, branch), teams); } /// @@ -1024,14 +978,13 @@ public Task> AddProtectedBranchTeamRestrictions(string owner /// The Id of the repository /// The name of the branch /// List of teams with push access to add - [Preview("luke-cage")] [ManualRoute("POST", "/repositories/{id}/branches/{branch}/protection/restrictions/teams")] public Task> AddProtectedBranchTeamRestrictions(long repositoryId, string branch, BranchProtectionTeamCollection teams) { Ensure.ArgumentNotNullOrEmptyString(branch, nameof(branch)); Ensure.ArgumentNotNull(teams, nameof(teams)); - return ApiConnection.Post>(ApiUrls.RepoRestrictionsTeams(repositoryId, branch), teams, AcceptHeaders.ProtectedBranchesRequiredApprovingApiPreview); + return ApiConnection.Post>(ApiUrls.RepoRestrictionsTeams(repositoryId, branch), teams); } /// @@ -1044,7 +997,6 @@ public Task> AddProtectedBranchTeamRestrictions(long reposit /// The name of the repository /// The name of the branch /// List of teams to remove - [Preview("luke-cage")] [ManualRoute("DELETE", "/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams")] public Task> DeleteProtectedBranchTeamRestrictions(string owner, string name, string branch, BranchProtectionTeamCollection teams) { @@ -1053,7 +1005,7 @@ public Task> DeleteProtectedBranchTeamRestrictions(string ow Ensure.ArgumentNotNullOrEmptyString(branch, nameof(branch)); Ensure.ArgumentNotNull(teams, nameof(teams)); - return ApiConnection.Delete>(ApiUrls.RepoRestrictionsTeams(owner, name, branch), teams, AcceptHeaders.ProtectedBranchesRequiredApprovingApiPreview); + return ApiConnection.Delete>(ApiUrls.RepoRestrictionsTeams(owner, name, branch), teams); } /// @@ -1065,14 +1017,13 @@ public Task> DeleteProtectedBranchTeamRestrictions(string ow /// The Id of the repository /// The name of the branch /// List of teams to remove - [Preview("luke-cage")] [ManualRoute("DELETE", "/repositories/{id}/branches/{branch}/protection/restrictions/teams")] public Task> DeleteProtectedBranchTeamRestrictions(long repositoryId, string branch, BranchProtectionTeamCollection teams) { Ensure.ArgumentNotNullOrEmptyString(branch, nameof(branch)); Ensure.ArgumentNotNull(teams, nameof(teams)); - return ApiConnection.Delete>(ApiUrls.RepoRestrictionsTeams(repositoryId, branch), teams, AcceptHeaders.ProtectedBranchesRequiredApprovingApiPreview); + return ApiConnection.Delete>(ApiUrls.RepoRestrictionsTeams(repositoryId, branch), teams); } /// @@ -1084,7 +1035,6 @@ public Task> DeleteProtectedBranchTeamRestrictions(long repo /// The owner of the repository /// The name of the repository /// The name of the branch - [Preview("luke-cage")] [ManualRoute("GET", "/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users")] public Task> GetAllProtectedBranchUserRestrictions(string owner, string name, string branch) { @@ -1092,7 +1042,7 @@ public Task> GetAllProtectedBranchUserRestrictions(string ow Ensure.ArgumentNotNullOrEmptyString(name, nameof(name)); Ensure.ArgumentNotNullOrEmptyString(branch, nameof(branch)); - return ApiConnection.Get>(ApiUrls.RepoRestrictionsUsers(owner, name, branch), null, AcceptHeaders.ProtectedBranchesRequiredApprovingApiPreview); + return ApiConnection.Get>(ApiUrls.RepoRestrictionsUsers(owner, name, branch), null); } /// @@ -1103,13 +1053,12 @@ public Task> GetAllProtectedBranchUserRestrictions(string ow /// /// The Id of the repository /// The name of the branch - [Preview("luke-cage")] [ManualRoute("GET", "/repositories/{id}/branches/{branch}/protection/restrictions/users")] public Task> GetAllProtectedBranchUserRestrictions(long repositoryId, string branch) { Ensure.ArgumentNotNullOrEmptyString(branch, nameof(branch)); - return ApiConnection.Get>(ApiUrls.RepoRestrictionsUsers(repositoryId, branch), null, AcceptHeaders.ProtectedBranchesRequiredApprovingApiPreview); + return ApiConnection.Get>(ApiUrls.RepoRestrictionsUsers(repositoryId, branch), null); } /// @@ -1122,7 +1071,6 @@ public Task> GetAllProtectedBranchUserRestrictions(long repo /// The name of the repository /// The name of the branch /// List of users with push access - [Preview("luke-cage")] [ManualRoute("UPDATE", "/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users")] public Task> UpdateProtectedBranchUserRestrictions(string owner, string name, string branch, BranchProtectionUserCollection users) { @@ -1131,7 +1079,7 @@ public Task> UpdateProtectedBranchUserRestrictions(string ow Ensure.ArgumentNotNullOrEmptyString(branch, nameof(branch)); Ensure.ArgumentNotNull(users, nameof(users)); - return ApiConnection.Put>(ApiUrls.RepoRestrictionsUsers(owner, name, branch), users, null, AcceptHeaders.ProtectedBranchesRequiredApprovingApiPreview); + return ApiConnection.Put>(ApiUrls.RepoRestrictionsUsers(owner, name, branch), users, null); } /// @@ -1143,14 +1091,13 @@ public Task> UpdateProtectedBranchUserRestrictions(string ow /// The Id of the repository /// The name of the branch /// List of users with push access - [Preview("luke-cage")] [ManualRoute("PUT", "/repositories/{id}/branches/{branch}/protection/restrictions/users")] public Task> UpdateProtectedBranchUserRestrictions(long repositoryId, string branch, BranchProtectionUserCollection users) { Ensure.ArgumentNotNullOrEmptyString(branch, nameof(branch)); Ensure.ArgumentNotNull(users, nameof(users)); - return ApiConnection.Put>(ApiUrls.RepoRestrictionsUsers(repositoryId, branch), users, null, AcceptHeaders.ProtectedBranchesRequiredApprovingApiPreview); + return ApiConnection.Put>(ApiUrls.RepoRestrictionsUsers(repositoryId, branch), users, null); } /// @@ -1163,7 +1110,6 @@ public Task> UpdateProtectedBranchUserRestrictions(long repo /// The name of the repository /// The name of the branch /// List of users with push access to add - [Preview("luke-cage")] [ManualRoute("POST", "/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users")] public Task> AddProtectedBranchUserRestrictions(string owner, string name, string branch, BranchProtectionUserCollection users) { @@ -1172,7 +1118,7 @@ public Task> AddProtectedBranchUserRestrictions(string owner Ensure.ArgumentNotNullOrEmptyString(branch, nameof(branch)); Ensure.ArgumentNotNull(users, nameof(users)); - return ApiConnection.Post>(ApiUrls.RepoRestrictionsUsers(owner, name, branch), users, AcceptHeaders.ProtectedBranchesRequiredApprovingApiPreview); + return ApiConnection.Post>(ApiUrls.RepoRestrictionsUsers(owner, name, branch), users); } /// @@ -1184,14 +1130,13 @@ public Task> AddProtectedBranchUserRestrictions(string owner /// The Id of the repository /// The name of the branch /// List of users with push access to add - [Preview("luke-cage")] [ManualRoute("POST", "/repositories/{id}/branches/{branch}/protection/restrictions/users")] public Task> AddProtectedBranchUserRestrictions(long repositoryId, string branch, BranchProtectionUserCollection users) { Ensure.ArgumentNotNullOrEmptyString(branch, nameof(branch)); Ensure.ArgumentNotNull(users, nameof(users)); - return ApiConnection.Post>(ApiUrls.RepoRestrictionsUsers(repositoryId, branch), users, AcceptHeaders.ProtectedBranchesRequiredApprovingApiPreview); + return ApiConnection.Post>(ApiUrls.RepoRestrictionsUsers(repositoryId, branch), users); } /// @@ -1204,7 +1149,6 @@ public Task> AddProtectedBranchUserRestrictions(long reposit /// The name of the repository /// The name of the branch /// List of users with push access to remove - [Preview("luke-cage")] [ManualRoute("DELETE", "/repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users")] public Task> DeleteProtectedBranchUserRestrictions(string owner, string name, string branch, BranchProtectionUserCollection users) { @@ -1213,7 +1157,7 @@ public Task> DeleteProtectedBranchUserRestrictions(string ow Ensure.ArgumentNotNullOrEmptyString(branch, nameof(branch)); Ensure.ArgumentNotNull(users, nameof(users)); - return ApiConnection.Delete>(ApiUrls.RepoRestrictionsUsers(owner, name, branch), users, AcceptHeaders.ProtectedBranchesRequiredApprovingApiPreview); + return ApiConnection.Delete>(ApiUrls.RepoRestrictionsUsers(owner, name, branch), users); } /// @@ -1225,14 +1169,13 @@ public Task> DeleteProtectedBranchUserRestrictions(string ow /// The Id of the repository /// The name of the branch /// List of users with push access to remove - [Preview("luke-cage")] [ManualRoute("DELETE", "/repositories/{id}/branches/{branch}/protection/restrictions/users")] public Task> DeleteProtectedBranchUserRestrictions(long repositoryId, string branch, BranchProtectionUserCollection users) { Ensure.ArgumentNotNullOrEmptyString(branch, nameof(branch)); Ensure.ArgumentNotNull(users, nameof(users)); - return ApiConnection.Delete>(ApiUrls.RepoRestrictionsUsers(repositoryId, branch), users, AcceptHeaders.ProtectedBranchesRequiredApprovingApiPreview); + return ApiConnection.Delete>(ApiUrls.RepoRestrictionsUsers(repositoryId, branch), users); } } } diff --git a/Octokit/Clients/RepositoryCommentsClient.cs b/Octokit/Clients/RepositoryCommentsClient.cs index acaa6b41ac..ff28b1a152 100644 --- a/Octokit/Clients/RepositoryCommentsClient.cs +++ b/Octokit/Clients/RepositoryCommentsClient.cs @@ -27,14 +27,13 @@ public RepositoryCommentsClient(IApiConnection apiConnection) /// The name of the repository /// The comment id /// http://developer.github.com/v3/repos/comments/#get-a-single-commit-comment - [Preview("squirrel-girl")] [ManualRoute("GET", "/repos/{owner}/{repo}/comments/{comment_id}")] public Task Get(string owner, string name, int number) { Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner)); Ensure.ArgumentNotNullOrEmptyString(name, nameof(name)); - return ApiConnection.Get(ApiUrls.CommitComment(owner, name, number), null, AcceptHeaders.ReactionsPreview); + return ApiConnection.Get(ApiUrls.CommitComment(owner, name, number), null); } /// @@ -43,11 +42,10 @@ public Task Get(string owner, string name, int number) /// The Id of the repository /// The comment id /// http://developer.github.com/v3/repos/comments/#get-a-single-commit-comment - [Preview("squirrel-girl")] [ManualRoute("GET", "/repositories/{id}/comments/{number}")] public Task Get(long repositoryId, int number) { - return ApiConnection.Get(ApiUrls.CommitComment(repositoryId, number), null, AcceptHeaders.ReactionsPreview); + return ApiConnection.Get(ApiUrls.CommitComment(repositoryId, number), null); } /// @@ -83,7 +81,6 @@ public Task> GetAllForRepository(long repositoryId) /// The name of the repository /// Options to change the API response /// http://developer.github.com/v3/repos/comments/#list-commit-comments-for-a-repository - [Preview("squirrel-girl")] [ManualRoute("GET", "/repos/{owner}/{repo}/comments")] public Task> GetAllForRepository(string owner, string name, ApiOptions options) { @@ -91,7 +88,7 @@ public Task> GetAllForRepository(string owner, stri Ensure.ArgumentNotNullOrEmptyString(name, nameof(name)); Ensure.ArgumentNotNull(options, nameof(options)); - return ApiConnection.GetAll(ApiUrls.CommitComments(owner, name), null, AcceptHeaders.ReactionsPreview, options); + return ApiConnection.GetAll(ApiUrls.CommitComments(owner, name), null, options); } /// @@ -100,13 +97,12 @@ public Task> GetAllForRepository(string owner, stri /// The Id of the repository /// Options to change the API response /// http://developer.github.com/v3/repos/comments/#list-commit-comments-for-a-repository - [Preview("squirrel-girl")] [ManualRoute("GET", "/repositories/{id}/comments")] public Task> GetAllForRepository(long repositoryId, ApiOptions options) { Ensure.ArgumentNotNull(options, nameof(options)); - return ApiConnection.GetAll(ApiUrls.CommitComments(repositoryId), null, AcceptHeaders.ReactionsPreview, options); + return ApiConnection.GetAll(ApiUrls.CommitComments(repositoryId), null, options); } /// @@ -148,7 +144,6 @@ public Task> GetAllForCommit(long repositoryId, str /// The sha of the commit /// Options to change the API response /// http://developer.github.com/v3/repos/comments/#list-comments-for-a-single-commit - [Preview("squirrel-girl")] [ManualRoute("GET", "/repos/{owner}/{repo}/commits/{commit_sha}/comments")] public Task> GetAllForCommit(string owner, string name, string sha, ApiOptions options) { @@ -157,7 +152,7 @@ public Task> GetAllForCommit(string owner, string n Ensure.ArgumentNotNullOrEmptyString(sha, nameof(sha)); Ensure.ArgumentNotNull(options, nameof(options)); - return ApiConnection.GetAll(ApiUrls.CommitComments(owner, name, sha), null, AcceptHeaders.ReactionsPreview, options); + return ApiConnection.GetAll(ApiUrls.CommitComments(owner, name, sha), null, options); } /// @@ -167,14 +162,13 @@ public Task> GetAllForCommit(string owner, string n /// The sha of the commit /// Options to change the API response /// http://developer.github.com/v3/repos/comments/#list-comments-for-a-single-commit - [Preview("squirrel-girl")] [ManualRoute("GET", "/repositories/{id}/commits/{commit_sha}/comments")] public Task> GetAllForCommit(long repositoryId, string sha, ApiOptions options) { Ensure.ArgumentNotNullOrEmptyString(sha, nameof(sha)); Ensure.ArgumentNotNull(options, nameof(options)); - return ApiConnection.GetAll(ApiUrls.CommitComments(repositoryId, sha), null, AcceptHeaders.ReactionsPreview, options); + return ApiConnection.GetAll(ApiUrls.CommitComments(repositoryId, sha), null, options); } /// diff --git a/Octokit/Clients/RepositoryCommitsClient.cs b/Octokit/Clients/RepositoryCommitsClient.cs index 52dc0326dd..8f03bdc7a9 100644 --- a/Octokit/Clients/RepositoryCommitsClient.cs +++ b/Octokit/Clients/RepositoryCommitsClient.cs @@ -203,7 +203,7 @@ public Task GetSha1(string owner, string name, string reference) Ensure.ArgumentNotNullOrEmptyString(name, nameof(name)); Ensure.ArgumentNotNullOrEmptyString(reference, nameof(reference)); - return ApiConnection.Get(ApiUrls.RepositoryCommit(owner, name, reference), null, AcceptHeaders.CommitReferenceSha1MediaType); + return ApiConnection.Get(ApiUrls.RepositoryCommit(owner, name, reference), null); } /// @@ -216,7 +216,7 @@ public Task GetSha1(long repositoryId, string reference) { Ensure.ArgumentNotNullOrEmptyString(reference, nameof(reference)); - return ApiConnection.Get(ApiUrls.RepositoryCommit(repositoryId, reference), null, AcceptHeaders.CommitReferenceSha1MediaType); + return ApiConnection.Get(ApiUrls.RepositoryCommit(repositoryId, reference), null); } } } diff --git a/Octokit/Clients/RepositoryForksClient.cs b/Octokit/Clients/RepositoryForksClient.cs index 89496dddab..3a32b59b70 100644 --- a/Octokit/Clients/RepositoryForksClient.cs +++ b/Octokit/Clients/RepositoryForksClient.cs @@ -168,7 +168,6 @@ public Task> GetAll(long repositoryId, RepositoryForks /// The owner of the repository /// The name of the repository /// Used to fork a repository - [Preview("mercy")] [ManualRoute("POST", "/repos/{owner}/{repo}/forks")] public Task Create(string owner, string name, NewRepositoryFork fork) { @@ -187,7 +186,6 @@ public Task Create(string owner, string name, NewRepositoryFork fork /// /// The Id of the repository /// Used to fork a repository - [Preview("mercy")] [ManualRoute("POST", "/repositories/{id}/forks")] public Task Create(long repositoryId, NewRepositoryFork fork) { diff --git a/Octokit/Clients/StarredClient.cs b/Octokit/Clients/StarredClient.cs index 94cef3dfa9..05374044fd 100644 --- a/Octokit/Clients/StarredClient.cs +++ b/Octokit/Clients/StarredClient.cs @@ -117,7 +117,7 @@ public Task> GetAllStargazersWithTimestamps(string owner Ensure.ArgumentNotNullOrEmptyString(name, nameof(name)); Ensure.ArgumentNotNull(options, nameof(options)); - return ApiConnection.GetAll(ApiUrls.Stargazers(owner, name), null, AcceptHeaders.StarCreationTimestamps, options); + return ApiConnection.GetAll(ApiUrls.Stargazers(owner, name), null, options); } /// @@ -131,7 +131,7 @@ public Task> GetAllStargazersWithTimestamps(long reposit { Ensure.ArgumentNotNull(options, nameof(options)); - return ApiConnection.GetAll(ApiUrls.Stargazers(repositoryId), null, AcceptHeaders.StarCreationTimestamps, options); + return ApiConnection.GetAll(ApiUrls.Stargazers(repositoryId), null, options); } /// @@ -177,7 +177,7 @@ public Task> GetAllForCurrentWithTimestamps(ApiOpt { Ensure.ArgumentNotNull(options, nameof(options)); - return ApiConnection.GetAll(ApiUrls.Starred(), null, AcceptHeaders.StarCreationTimestamps, options); + return ApiConnection.GetAll(ApiUrls.Starred(), null, options); } /// @@ -237,7 +237,7 @@ public Task> GetAllForCurrentWithTimestamps(Starre Ensure.ArgumentNotNull(request, nameof(request)); Ensure.ArgumentNotNull(options, nameof(options)); - return ApiConnection.GetAll(ApiUrls.Starred(), request.ToParametersDictionary(), AcceptHeaders.StarCreationTimestamps, options); + return ApiConnection.GetAll(ApiUrls.Starred(), request.ToParametersDictionary(), options); } /// @@ -293,7 +293,7 @@ public Task> GetAllForUserWithTimestamps(string us Ensure.ArgumentNotNullOrEmptyString(user, nameof(user)); Ensure.ArgumentNotNull(options, nameof(options)); - return ApiConnection.GetAll(ApiUrls.StarredByUser(user), null, AcceptHeaders.StarCreationTimestamps, options); + return ApiConnection.GetAll(ApiUrls.StarredByUser(user), null, options); } /// @@ -359,7 +359,7 @@ public Task> GetAllForUserWithTimestamps(string us Ensure.ArgumentNotNull(request, nameof(request)); Ensure.ArgumentNotNull(options, nameof(options)); - return ApiConnection.GetAll(ApiUrls.StarredByUser(user), request.ToParametersDictionary(), AcceptHeaders.StarCreationTimestamps, options); + return ApiConnection.GetAll(ApiUrls.StarredByUser(user), request.ToParametersDictionary(), options); } /// diff --git a/Octokit/Clients/TeamsClient.cs b/Octokit/Clients/TeamsClient.cs index 08a1bfd65b..2d01a3445b 100644 --- a/Octokit/Clients/TeamsClient.cs +++ b/Octokit/Clients/TeamsClient.cs @@ -503,7 +503,7 @@ public Task> GetAllPendingInvita [ManualRoute("GET", "/teams/{team_id}/invitations")] public Task> GetAllPendingInvitations(int id, ApiOptions options) { - return ApiConnection.GetAll(ApiUrls.TeamPendingInvitations(id), null, AcceptHeaders.OrganizationMembershipPreview, options); + return ApiConnection.GetAll(ApiUrls.TeamPendingInvitations(id), null, options); } } } diff --git a/Octokit/Helpers/AcceptHeaders.cs b/Octokit/Helpers/AcceptHeaders.cs index a2723a8e27..c39c1baddf 100644 --- a/Octokit/Helpers/AcceptHeaders.cs +++ b/Octokit/Helpers/AcceptHeaders.cs @@ -1,7 +1,4 @@ -using System; -using System.Diagnostics.CodeAnalysis; - -namespace Octokit +namespace Octokit { public static class AcceptHeaders { @@ -11,64 +8,10 @@ public static class AcceptHeaders public const string StableVersionJson = "application/vnd.github.v3+json"; - public const string CommitReferenceSha1MediaType = "application/vnd.github.v3.sha"; - /// /// Support for retrieving raw file content with the method. /// /// https://developer.github.com/v3/repos/contents/#custom-media-types public const string RawContentMediaType = "application/vnd.github.v3.raw"; - - public const string StarCreationTimestamps = "application/vnd.github.v3.star+json"; - - public const string MigrationsApiPreview = "application/vnd.github.wyandotte-preview+json"; - - public const string ReactionsPreview = "application/vnd.github.squirrel-girl-preview+json"; - - public const string DeploymentApiPreview = "application/vnd.github.ant-man-preview+json"; - - public const string IssueTimelineApiPreview = "application/vnd.github.mockingbird-preview+json"; - - public const string DraftPullRequestApiPreview = "application/vnd.github.shadow-cat-preview+json"; - - public const string ProjectsApiPreview = "application/vnd.github.inertia-preview+json"; - - [Obsolete("API is considered legacy")] - public const string OrganizationMembershipPreview = "application/vnd.github.korra-preview+json"; - - public const string GitHubAppsPreview = "application/vnd.github.machine-man-preview+json"; - - public const string PreReceiveEnvironmentsPreview = "application/vnd.github.eye-scream-preview+json"; - - public const string ChecksApiPreview = "application/vnd.github.antiope-preview+json"; - - public const string ProtectedBranchesRequiredApprovingApiPreview = "application/vnd.github.luke-cage-preview+json"; - - public const string IssueEventsApiPreview = "application/vnd.github.starfox-preview+json"; - - public const string DeploymentStatusesPreview = "application/vnd.github.flash-preview+json"; - - public const string OAuthApplicationsPreview = "application/vnd.github.doctor-strange-preview+json"; - - public const string RepositoryTopicsPreview = "application/vnd.github.mercy-preview+json"; - - public const string VisibilityPreview = "application/vnd.github.nebula-preview+json"; - - public const string TemplatePreview = "application/vnd.github.baptiste-preview+json"; - - /// - /// Combines multiple preview headers. GitHub API supports Accept header with multiple - /// values separated by comma. - /// - /// Accept header values that will be combine to single Accept header. - /// - /// This Accept header application/vnd.github.loki-preview+json,application/vnd.github.drax-preview+json - /// indicated we want both Protected Branches and Licenses preview APIs. - /// - /// Accept header value. - public static string Concat(params string[] headers) - { - return string.Join(",", headers); - } } } diff --git a/Octokit/Helpers/PreviewAttribute.cs b/Octokit/Helpers/PreviewAttribute.cs deleted file mode 100644 index 5a125a3507..0000000000 --- a/Octokit/Helpers/PreviewAttribute.cs +++ /dev/null @@ -1,20 +0,0 @@ -using System; - -namespace Octokit -{ - /// - /// Metadata for tracking which endpoints rely on preview API behaviour - /// - /// https://developer.github.com/v3/previews/ - - [AttributeUsage(AttributeTargets.Method, AllowMultiple = true, Inherited = false)] - public class PreviewAttribute : Attribute - { - public string Name { get; private set; } - - public PreviewAttribute(string name) - { - this.Name = name; - } - } -} From b552f14ff9cd04d37da513aa78e8d85a08dca823 Mon Sep 17 00:00:00 2001 From: Chris Simpson Date: Wed, 27 Jul 2022 07:39:01 +0100 Subject: [PATCH 2/4] Fixing up the remaining unit tests. Now to check the integration tests... perhaps a smoke pack might be good? --- Octokit.Tests.Integration/Helper.cs | 2 +- Octokit.Tests/Clients/AssigneesClientTests.cs | 4 - .../Clients/AuthorizationsClientTests.cs | 9 +- .../Clients/CheckSuitesClientTests.cs | 20 +-- .../CommitCommentReactionsClientTests.cs | 12 +- .../Clients/DeploymentStatusClientTests.cs | 16 +- .../Clients/DeploymentsClientTests.cs | 12 +- ...rprisePreReceiveEnvironmentsClientTests.cs | 20 +-- .../GitHubAppInstallationsClientTests.cs | 4 - .../Clients/GitHubAppsClientTests.cs | 24 +-- .../IssueCommentReactionsClientTests.cs | 12 +- .../Clients/IssueCommentsClientTests.cs | 16 +- .../Clients/IssueReactionsClientTests.cs | 12 +- .../Clients/IssueTimelineClientTests.cs | 4 - Octokit.Tests/Clients/IssuesClientTests.cs | 19 +- .../Clients/IssuesEventsClientTests.cs | 20 +-- .../Clients/MigrationsClientTests.cs | 23 +-- .../Clients/OrganizationMembersClientTests.cs | 4 +- ...nizationOutsideCollaboratorsClientTests.cs | 21 +-- .../Clients/ProjectCardsClientTests.cs | 16 +- .../Clients/ProjectColumnsClientTests.cs | 15 +- Octokit.Tests/Clients/ProjectsClientTests.cs | 16 +- ...equestReviewCommentReactionsClientTests.cs | 12 +- .../PullRequestReviewCommentsClientTests.cs | 21 +-- .../Clients/PullRequestsClientTests.cs | 28 +-- Octokit.Tests/Clients/ReactionsClientTests.cs | 2 +- .../Clients/RepoCollaboratorsClientTests.cs | 6 +- .../Clients/RepositoriesClientTests.cs | 53 +++--- .../Clients/RepositoryBranchesClientTests.cs | 168 ++++++------------ .../Clients/RepositoryCommentsClientTests.cs | 22 +-- .../Clients/RespositoryCommitsClientTests.cs | 6 +- Octokit.Tests/Clients/StarredClientTests.cs | 29 ++- Octokit.Tests/Clients/TeamsClientTests.cs | 1 - Octokit.Tests/Helpers/MockedIApiConnection.cs | 2 + ...rprisePreReceiveEnvironmentsClientTests.cs | 4 +- .../ObservableCheckRunsClientTests.cs | 32 ++-- .../ObservableCheckSuitesClientTests.cs | 8 +- ...rvableGitHubAppInstallationsClientTests.cs | 8 +- .../ObservableGitHubAppsClientTests.cs | 8 +- .../ObservableIssueCommentsClientTests.cs | 21 +-- .../ObservableIssueTimelineClientTests.cs | 20 +-- .../Reactive/ObservableIssuesClientTests.cs | 39 ++-- ...bservableOrganizationMembersClientTests.cs | 6 +- ...nizationOutsideCollaboratorsClientTests.cs | 12 +- .../ObservableProjectCardsClientTests.cs | 4 +- .../ObservableProjectColumnsClientTests.cs | 2 +- .../Reactive/ObservableProjectsClientTests.cs | 12 +- ...blePullRequestReviewCommentsClientTests.cs | 65 ++++--- .../ObservablePullRequestsClientTests.cs | 24 +-- ...ObservableRepositoryCommentsClientTests.cs | 16 +- .../Reactive/ObservableStarredClientTests.cs | 24 +-- .../Reactive/ObservableTeamsClientTests.cs | 6 +- .../OrganizationOutsideCollaboratorsClient.cs | 2 +- Octokit/Clients/RepositoryBranchesClient.cs | 20 +-- 54 files changed, 396 insertions(+), 588 deletions(-) diff --git a/Octokit.Tests.Integration/Helper.cs b/Octokit.Tests.Integration/Helper.cs index bea408208f..af7742b5e4 100644 --- a/Octokit.Tests.Integration/Helper.cs +++ b/Octokit.Tests.Integration/Helper.cs @@ -336,7 +336,7 @@ public static void DeleteInvitations(IConnection connection, List invite { foreach (var invitee in invitees) { - connection.Delete(new Uri($"orgs/{Organization}/memberships/{invitee}", UriKind.Relative), null).Wait(TimeSpan.FromSeconds(15)); + connection.Delete(new Uri($"orgs/{Organization}/memberships/{invitee}", UriKind.Relative)).Wait(TimeSpan.FromSeconds(15)); } } catch { } diff --git a/Octokit.Tests/Clients/AssigneesClientTests.cs b/Octokit.Tests/Clients/AssigneesClientTests.cs index 652838e82c..e48998e43c 100644 --- a/Octokit.Tests/Clients/AssigneesClientTests.cs +++ b/Octokit.Tests/Clients/AssigneesClientTests.cs @@ -25,7 +25,6 @@ public async Task RequestsCorrectUrl() connection.Received().GetAll( Arg.Is(u => u.ToString() == "repos/fake/repo/assignees"), null, - AcceptHeaders.StableVersion, Args.ApiOptions); } @@ -40,7 +39,6 @@ public async Task RequestsCorrectUrlWithRepositoryId() connection.Received().GetAll( Arg.Is(u => u.ToString() == "repositories/1/assignees"), null, - AcceptHeaders.StableVersion, Args.ApiOptions); } @@ -62,7 +60,6 @@ public async Task RequestsCorrectUrlWithApiOptions() connection.Received().GetAll( Arg.Is(u => u.ToString() == "repos/fake/repo/assignees"), null, - AcceptHeaders.StableVersion, options); } @@ -84,7 +81,6 @@ public async Task RequestsCorrectUrlWithRepositoryIdWithApiOptions() connection.Received().GetAll( Arg.Is(u => u.ToString() == "repositories/1/assignees"), null, - AcceptHeaders.StableVersion, options); } diff --git a/Octokit.Tests/Clients/AuthorizationsClientTests.cs b/Octokit.Tests/Clients/AuthorizationsClientTests.cs index 0464fbcc14..bb9343c5f3 100644 --- a/Octokit.Tests/Clients/AuthorizationsClientTests.cs +++ b/Octokit.Tests/Clients/AuthorizationsClientTests.cs @@ -292,8 +292,7 @@ public async Task ChecksApplicationAuthenticateAtCorrectUrl() client.Received().Post( Arg.Is(u => u.ToString() == "applications/clientId/token"), - Arg.Is(o => o.GetType().GetProperty("access_token").GetValue(o).ToString() == "accessToken"), - "application/vnd.github.doctor-strange-preview+json"); + Arg.Is(o => o.GetType().GetProperty("access_token").GetValue(o).ToString() == "accessToken")); } [Fact] @@ -321,8 +320,7 @@ public async Task ResetsApplicationAuthenticationAtCorrectUrl() client.Received().Patch( Arg.Is(u => u.ToString() == "applications/clientId/token"), - Arg.Is(o => o.GetType().GetProperty("access_token").GetValue(o).ToString() == "accessToken"), - "application/vnd.github.doctor-strange-preview+json"); + Arg.Is(o => o.GetType().GetProperty("access_token").GetValue(o).ToString() == "accessToken")); } [Fact] @@ -350,8 +348,7 @@ public async Task RevokesApplicationAuthenticationAtCorrectUrl() client.Received().Delete( Arg.Is(u => u.ToString() == "applications/clientId/token"), - Arg.Is(o => o.GetType().GetProperty("access_token").GetValue(o).ToString() == "accessToken"), - "application/vnd.github.doctor-strange-preview+json"); + Arg.Is(o => o.GetType().GetProperty("access_token").GetValue(o).ToString() == "accessToken")); } [Fact] diff --git a/Octokit.Tests/Clients/CheckSuitesClientTests.cs b/Octokit.Tests/Clients/CheckSuitesClientTests.cs index 6e6821fecb..f9d91ad383 100644 --- a/Octokit.Tests/Clients/CheckSuitesClientTests.cs +++ b/Octokit.Tests/Clients/CheckSuitesClientTests.cs @@ -31,8 +31,7 @@ public async Task RequestsCorrectUrl() connection.Received().Get( Arg.Is(u => u.ToString() == "repos/fake/repo/check-suites/1"), - Arg.Any>(), - "application/vnd.github.antiope-preview+json"); + Arg.Any>()); } [Fact] @@ -45,8 +44,7 @@ public async Task RequestsCorrectUrlWithRepositoryId() connection.Received().Get( Arg.Is(u => u.ToString() == "repositories/1/check-suites/1"), - Arg.Any>(), - "application/vnd.github.antiope-preview+json"); + Arg.Any>()); } [Fact] @@ -220,8 +218,7 @@ public async Task RequestsCorrectUrl() connection.Received().Patch( Arg.Is(u => u.ToString() == "repos/fake/repo/check-suites/preferences"), - preferences, - "application/vnd.github.antiope-preview+json"); + preferences); } [Fact] @@ -236,8 +233,7 @@ public async Task RequestsCorrectUrlWithRepositoryId() connection.Received().Patch( Arg.Is(u => u.ToString() == "repositories/1/check-suites/preferences"), - preferences, - "application/vnd.github.antiope-preview+json"); + preferences); } [Fact] @@ -337,9 +333,7 @@ public async Task RequestsCorrectUrl() await client.Rerequest("fake", "repo", 1); connection.Connection.Received().Post( - Arg.Is(u => u.ToString() == "repos/fake/repo/check-suites/1/rerequest"), - Args.Object, - "application/vnd.github.antiope-preview+json"); + Arg.Is(u => u.ToString() == "repos/fake/repo/check-suites/1/rerequest")); } [Fact] @@ -351,9 +345,7 @@ public async Task RequestsCorrectUrlWithRepositoryId() await client.Rerequest(1, 1); connection.Connection.Received().Post( - Arg.Is(u => u.ToString() == "repositories/1/check-suites/1/rerequest"), - Args.Object, - "application/vnd.github.antiope-preview+json"); + Arg.Is(u => u.ToString() == "repositories/1/check-suites/1/rerequest")); } [Fact] diff --git a/Octokit.Tests/Clients/CommitCommentReactionsClientTests.cs b/Octokit.Tests/Clients/CommitCommentReactionsClientTests.cs index fd66b02a43..81347732b2 100644 --- a/Octokit.Tests/Clients/CommitCommentReactionsClientTests.cs +++ b/Octokit.Tests/Clients/CommitCommentReactionsClientTests.cs @@ -27,7 +27,7 @@ public async Task RequestsCorrectUrl() await client.GetAll("fake", "repo", 42); - connection.Received().GetAll(Arg.Is(u => u.ToString() == "repos/fake/repo/comments/42/reactions"), null, "application/vnd.github.squirrel-girl-preview+json", Args.ApiOptions); + connection.Received().GetAll(Arg.Is(u => u.ToString() == "repos/fake/repo/comments/42/reactions"), null, Args.ApiOptions); } [Fact] @@ -45,7 +45,7 @@ public async Task RequestsCorrectUrlApiOptions() await client.GetAll("fake", "repo", 42, options); - connection.Received().GetAll(Arg.Is(u => u.ToString() == "repos/fake/repo/comments/42/reactions"), null, "application/vnd.github.squirrel-girl-preview+json", options); + connection.Received().GetAll(Arg.Is(u => u.ToString() == "repos/fake/repo/comments/42/reactions"), null, options); } [Fact] @@ -56,7 +56,7 @@ public async Task RequestsCorrectUrlWithRepositoryId() await client.GetAll(1, 42); - connection.Received().GetAll(Arg.Is(u => u.ToString() == "repositories/1/comments/42/reactions"), null, "application/vnd.github.squirrel-girl-preview+json", Args.ApiOptions); + connection.Received().GetAll(Arg.Is(u => u.ToString() == "repositories/1/comments/42/reactions"), null, Args.ApiOptions); } [Fact] @@ -74,7 +74,7 @@ public async Task RequestsCorrectUrlWithRepositoryIdApiOptions() await client.GetAll(1, 42, options); - connection.Received().GetAll(Arg.Is(u => u.ToString() == "repositories/1/comments/42/reactions"), null, "application/vnd.github.squirrel-girl-preview+json", options); + connection.Received().GetAll(Arg.Is(u => u.ToString() == "repositories/1/comments/42/reactions"), null, options); } [Fact] @@ -113,7 +113,7 @@ public void RequestsCorrectUrl() client.Create("fake", "repo", 1, newReaction); - connection.Received().Post(Arg.Is(u => u.ToString() == "repos/fake/repo/comments/1/reactions"), newReaction, "application/vnd.github.squirrel-girl-preview+json"); + connection.Received().Post(Arg.Is(u => u.ToString() == "repos/fake/repo/comments/1/reactions"), newReaction); } [Fact] @@ -126,7 +126,7 @@ public void RequestsCorrectUrlWithRepositoryId() client.Create(1, 1, newReaction); - connection.Received().Post(Arg.Is(u => u.ToString() == "repositories/1/comments/1/reactions"), newReaction, "application/vnd.github.squirrel-girl-preview+json"); + connection.Received().Post(Arg.Is(u => u.ToString() == "repositories/1/comments/1/reactions"), newReaction); } [Fact] diff --git a/Octokit.Tests/Clients/DeploymentStatusClientTests.cs b/Octokit.Tests/Clients/DeploymentStatusClientTests.cs index 9cf4c083ef..90791a3192 100644 --- a/Octokit.Tests/Clients/DeploymentStatusClientTests.cs +++ b/Octokit.Tests/Clients/DeploymentStatusClientTests.cs @@ -21,7 +21,6 @@ public async Task RequestsCorrectUrl() connection.Received().GetAll< DeploymentStatus>(Arg.Is(u => u.ToString() == expectedUrl), null, - "application/vnd.github.ant-man-preview+json,application/vnd.github.flash-preview+json", Args.ApiOptions); } @@ -36,7 +35,6 @@ public async Task RequestsCorrectUrlWithRepositoryId() connection.Received().GetAll(Arg.Is(u => u.ToString() == expectedUrl), null, - "application/vnd.github.ant-man-preview+json,application/vnd.github.flash-preview+json", Args.ApiOptions); } @@ -59,7 +57,6 @@ public async Task RequestsCorrectUrlWithApiOptions() connection.Received().GetAll( Arg.Is(u => u.ToString() == expectedUrl), null, - "application/vnd.github.ant-man-preview+json,application/vnd.github.flash-preview+json", options); } @@ -81,7 +78,6 @@ public async Task RequestsCorrectUrlWithRepositoryIdWithApiOptions() connection.Received().GetAll(Arg.Is(u => u.ToString() == expectedUrl), null, - "application/vnd.github.ant-man-preview+json,application/vnd.github.flash-preview+json", options); } @@ -137,8 +133,7 @@ public void PostsToCorrectUrl() client.Create("owner", "repo", 1, newDeploymentStatus); connection.Received().Post(Arg.Is(u => u.ToString() == expectedUrl), - newDeploymentStatus, - "application/vnd.github.ant-man-preview+json,application/vnd.github.flash-preview+json"); + newDeploymentStatus); } [Fact] @@ -151,8 +146,7 @@ public void PostsToCorrectUrlWithRepositoryId() client.Create(1, 1, newDeploymentStatus); connection.Received().Post(Arg.Is(u => u.ToString() == expectedUrl), - Arg.Any(), - "application/vnd.github.ant-man-preview+json,application/vnd.github.flash-preview+json"); + Arg.Any()); } [Fact] @@ -194,8 +188,7 @@ public void PassesNewDeploymentRequest() client.Create("owner", "repo", 1, newDeploymentStatus); connection.Received().Post(Arg.Is(u => u.ToString() == expectedUrl), - newDeploymentStatus, - Arg.Any()); + newDeploymentStatus); } [Fact] @@ -208,8 +201,7 @@ public void SendsPreviewAcceptHeaders() client.Create("owner", "repo", 1, newDeploymentStatus); connection.Received(1).Post(Arg.Is(u => u.ToString() == expectedUrl), - Arg.Any(), - Arg.Is(s => s == "application/vnd.github.ant-man-preview+json,application/vnd.github.flash-preview+json")); + Arg.Any()); } } diff --git a/Octokit.Tests/Clients/DeploymentsClientTests.cs b/Octokit.Tests/Clients/DeploymentsClientTests.cs index 4605743736..5515d7d39f 100644 --- a/Octokit.Tests/Clients/DeploymentsClientTests.cs +++ b/Octokit.Tests/Clients/DeploymentsClientTests.cs @@ -59,9 +59,7 @@ public async Task RequestsCorrectUrl() await client.GetAll(owner, name); connection.Received(1) - .GetAll(Arg.Is(u => u.ToString() == expectedUrl), null, - "application/vnd.github.ant-man-preview+json", - Args.ApiOptions); + .GetAll(Arg.Is(u => u.ToString() == expectedUrl), null, Args.ApiOptions); } [Fact] @@ -97,7 +95,6 @@ public async Task RequestsCorrectUrlWithApiOptions() connection.Received(1) .GetAll(Arg.Is(u => u.ToString() == expectedUrl), null, - "application/vnd.github.ant-man-preview+json", options); } @@ -133,7 +130,6 @@ public void RequestsCorrectUrlWithPreviewAcceptHeaders() connection.Received(1) .GetAll(Arg.Is(u => u.ToString() == expectedUrl), Arg.Any>(), - "application/vnd.github.ant-man-preview+json", Args.ApiOptions); } } @@ -185,8 +181,7 @@ public void PostsToDeploymentsUrl() client.Create("owner", "name", newDeployment); connection.Received(1).Post(Arg.Is(u => u.ToString() == expectedUrl), - newDeployment, - "application/vnd.github.ant-man-preview+json"); + newDeployment); } [Fact] @@ -211,8 +206,7 @@ public void SendsPreviewAcceptHeaders() client.Create("owner", "name", newDeployment); connection.Received(1).Post(Arg.Any(), - Arg.Any(), - "application/vnd.github.ant-man-preview+json"); + Arg.Any()); } } diff --git a/Octokit.Tests/Clients/Enterprise/EnterprisePreReceiveEnvironmentsClientTests.cs b/Octokit.Tests/Clients/Enterprise/EnterprisePreReceiveEnvironmentsClientTests.cs index c1ee944eca..a4c0fe950e 100644 --- a/Octokit.Tests/Clients/Enterprise/EnterprisePreReceiveEnvironmentsClientTests.cs +++ b/Octokit.Tests/Clients/Enterprise/EnterprisePreReceiveEnvironmentsClientTests.cs @@ -28,7 +28,6 @@ public async Task RequestsCorrectUrl() connection.Received().GetAll(Arg.Is(u => u.ToString() == "admin/pre-receive-environments"), null, - "application/vnd.github.eye-scream-preview+json", Args.ApiOptions); } @@ -49,7 +48,6 @@ public async Task RequestsCorrectUrlWithApiOptions() connection.Received().GetAll(Arg.Is(u => u.ToString() == "admin/pre-receive-environments"), null, - "application/vnd.github.eye-scream-preview+json", options); } } @@ -65,8 +63,7 @@ public async Task RequestsTheCorrectUrl() await client.Get(1); connection.Received().Get(Arg.Is(u => u.ToString() == "admin/pre-receive-environments/1"), - null, - "application/vnd.github.eye-scream-preview+json"); + null); } } @@ -82,8 +79,7 @@ public async Task RequestsCorrectUrl() await client.Create(data); connection.Received().Post(Arg.Is(u => u.ToString() == "admin/pre-receive-environments"), - data, - "application/vnd.github.eye-scream-preview+json"); + data); } [Fact] @@ -115,8 +111,7 @@ public async Task RequestsTheCorrectUrl() await client.Edit(1, data); connection.Received().Patch(Arg.Is(u => u.ToString() == "admin/pre-receive-environments/1"), - data, - "application/vnd.github.eye-scream-preview+json"); + data); } [Fact] @@ -139,8 +134,7 @@ public async Task RequestsTheCorrectUrl() await client.Delete(1); connection.Received().Delete(Arg.Is(u => u.ToString() == "admin/pre-receive-environments/1"), - Arg.Any(), - "application/vnd.github.eye-scream-preview+json"); + Arg.Any()); } } @@ -155,8 +149,7 @@ public async Task RequestsTheCorrectUrl() await client.DownloadStatus(1); connection.Received().Get(Arg.Is(u => u.ToString() == "admin/pre-receive-environments/1/downloads/latest"), - null, - "application/vnd.github.eye-scream-preview+json"); + null); } } @@ -171,8 +164,7 @@ public async Task RequestsTheCorrectUrl() await client.TriggerDownload(1); connection.Received().Post(Arg.Is(u => u.ToString() == "admin/pre-receive-environments/1/downloads"), - Arg.Any(), - "application/vnd.github.eye-scream-preview+json"); + Arg.Any()); } } } diff --git a/Octokit.Tests/Clients/GitHubAppInstallationsClientTests.cs b/Octokit.Tests/Clients/GitHubAppInstallationsClientTests.cs index cbdddc24ae..b6e77f3e77 100644 --- a/Octokit.Tests/Clients/GitHubAppInstallationsClientTests.cs +++ b/Octokit.Tests/Clients/GitHubAppInstallationsClientTests.cs @@ -30,7 +30,6 @@ public void GetsFromCorrectUrl() connection.Received().GetAll( Arg.Is(u => u.ToString() == "installation/repositories"), null, - "application/vnd.github.machine-man-preview+json", Args.ApiOptions); } @@ -52,7 +51,6 @@ public void GetsFromCorrectUrllWithApiOptions() connection.Received().GetAll( Arg.Is(u => u.ToString() == "installation/repositories"), null, - "application/vnd.github.machine-man-preview+json", options); } } @@ -70,7 +68,6 @@ public void GetsFromCorrectUrl() connection.Received().GetAll( Arg.Is(u => u.ToString() == "user/installations/1234/repositories"), null, - "application/vnd.github.machine-man-preview+json", Args.ApiOptions); } @@ -92,7 +89,6 @@ public void GetsFromCorrectUrllWithApiOptions() connection.Received().GetAll( Arg.Is(u => u.ToString() == "user/installations/1234/repositories"), null, - "application/vnd.github.machine-man-preview+json", options); } } diff --git a/Octokit.Tests/Clients/GitHubAppsClientTests.cs b/Octokit.Tests/Clients/GitHubAppsClientTests.cs index bdd26c21c4..5647679eb3 100644 --- a/Octokit.Tests/Clients/GitHubAppsClientTests.cs +++ b/Octokit.Tests/Clients/GitHubAppsClientTests.cs @@ -44,7 +44,7 @@ public void GetsFromCorrectUrl() client.Get("foobar"); - connection.Received().Get(Arg.Is(u => u.ToString() == "apps/foobar"), null, "application/vnd.github.machine-man-preview+json"); + connection.Received().Get(Arg.Is(u => u.ToString() == "apps/foobar"), null); } } @@ -58,7 +58,7 @@ public void GetsFromCorrectUrl() client.GetCurrent(); - connection.Received().Get(Arg.Is(u => u.ToString() == "app"), null, "application/vnd.github.machine-man-preview+json"); + connection.Received().Get(Arg.Is(u => u.ToString() == "app"), null); } } @@ -81,7 +81,7 @@ public async Task RequestsCorrectUrl() client.GetAllInstallationsForCurrent(); - connection.Received().GetAll(Arg.Is(u => u.ToString() == "app/installations"), null, "application/vnd.github.machine-man-preview+json", Args.ApiOptions); + connection.Received().GetAll(Arg.Is(u => u.ToString() == "app/installations"), null, Args.ApiOptions); } [Fact] @@ -99,7 +99,7 @@ public void RequestsTheCorrectUrlWithApiOptions() client.GetAllInstallationsForCurrent(options); - connection.Received().GetAll(Arg.Is(u => u.ToString() == "app/installations"), null, "application/vnd.github.machine-man-preview+json", options); + connection.Received().GetAll(Arg.Is(u => u.ToString() == "app/installations"), null, options); } } @@ -113,7 +113,7 @@ public void GetsFromCorrectUrl() client.GetInstallationForCurrent(123); - connection.Received().Get(Arg.Is(u => u.ToString() == "app/installations/123"), null, "application/vnd.github.machine-man-preview+json"); + connection.Received().Get(Arg.Is(u => u.ToString() == "app/installations/123"), null); } } @@ -127,7 +127,7 @@ public async Task GetsFromCorrectUrl() await client.GetAllInstallationsForCurrentUser(); - await connection.Received().GetAll(Arg.Is(u => u.ToString() == "user/installations"), null, "application/vnd.github.machine-man-preview+json"); + await connection.Received().GetAll(Arg.Is(u => u.ToString() == "user/installations")); } [Fact] @@ -145,7 +145,7 @@ public async Task GetsFromCorrectUrlWithOptions() await client.GetAllInstallationsForCurrentUser(options); - await connection.Received().GetAll(Arg.Is(u => u.ToString() == "user/installations"), null, "application/vnd.github.machine-man-preview+json", options); + await connection.Received().GetAll(Arg.Is(u => u.ToString() == "user/installations"), null, options); } } @@ -161,7 +161,7 @@ public void PostsToCorrectUrl() client.CreateInstallationToken(fakeInstallationId); - connection.Received().Post(Arg.Is(u => u.ToString() == "app/installations/3141/access_tokens"), string.Empty, "application/vnd.github.machine-man-preview+json"); + connection.Received().Post(Arg.Is(u => u.ToString() == "app/installations/3141/access_tokens"), string.Empty); } } @@ -193,7 +193,7 @@ public void GetsFromCorrectUrl() client.GetOrganizationInstallationForCurrent("ducks"); - connection.Received().Get(Arg.Is(u => u.ToString() == "orgs/ducks/installation"), null, "application/vnd.github.machine-man-preview+json"); + connection.Received().Get(Arg.Is(u => u.ToString() == "orgs/ducks/installation"), null); } } @@ -227,7 +227,7 @@ public void GetsFromCorrectUrl() client.GetRepositoryInstallationForCurrent("mighty", "ducks"); - connection.Received().Get(Arg.Is(u => u.ToString() == "repos/mighty/ducks/installation"), null, "application/vnd.github.machine-man-preview+json"); + connection.Received().Get(Arg.Is(u => u.ToString() == "repos/mighty/ducks/installation"), null); } [Fact] @@ -238,7 +238,7 @@ public void GetsFromCorrectUrlByRepositoryId() client.GetRepositoryInstallationForCurrent(1234); - connection.Received().Get(Arg.Is(u => u.ToString() == "repositories/1234/installation"), null, "application/vnd.github.machine-man-preview+json"); + connection.Received().Get(Arg.Is(u => u.ToString() == "repositories/1234/installation"), null); } } @@ -270,7 +270,7 @@ public void GetsFromCorrectUrl() client.GetUserInstallationForCurrent("ducks"); - connection.Received().Get(Arg.Is(u => u.ToString() == "users/ducks/installation"), null, "application/vnd.github.machine-man-preview+json"); + connection.Received().Get(Arg.Is(u => u.ToString() == "users/ducks/installation"), null); } } } diff --git a/Octokit.Tests/Clients/IssueCommentReactionsClientTests.cs b/Octokit.Tests/Clients/IssueCommentReactionsClientTests.cs index d5c17d383c..bc25009a84 100644 --- a/Octokit.Tests/Clients/IssueCommentReactionsClientTests.cs +++ b/Octokit.Tests/Clients/IssueCommentReactionsClientTests.cs @@ -26,7 +26,7 @@ public async Task RequestsCorrectUrl() await client.GetAll("fake", "repo", 42); - connection.Received().GetAll(Arg.Is(u => u.ToString() == "repos/fake/repo/issues/comments/42/reactions"), null, "application/vnd.github.squirrel-girl-preview+json", Args.ApiOptions); + connection.Received().GetAll(Arg.Is(u => u.ToString() == "repos/fake/repo/issues/comments/42/reactions"), null, Args.ApiOptions); } [Fact] @@ -44,7 +44,7 @@ public async Task RequestsCorrectUrlApiOptions() await client.GetAll("fake", "repo", 42, options); - connection.Received().GetAll(Arg.Is(u => u.ToString() == "repos/fake/repo/issues/comments/42/reactions"), null, "application/vnd.github.squirrel-girl-preview+json", options); + connection.Received().GetAll(Arg.Is(u => u.ToString() == "repos/fake/repo/issues/comments/42/reactions"), null, options); } [Fact] @@ -55,7 +55,7 @@ public async Task RequestsCorrectUrlWithRepositoryId() await client.GetAll(1, 42); - connection.Received().GetAll(Arg.Is(u => u.ToString() == "repositories/1/issues/comments/42/reactions"), null, "application/vnd.github.squirrel-girl-preview+json", Args.ApiOptions); + connection.Received().GetAll(Arg.Is(u => u.ToString() == "repositories/1/issues/comments/42/reactions"), null, Args.ApiOptions); } [Fact] @@ -73,7 +73,7 @@ public async Task RequestsCorrectUrlWithRepositoryIdApiOptions() await client.GetAll(1, 42, options); - connection.Received().GetAll(Arg.Is(u => u.ToString() == "repositories/1/issues/comments/42/reactions"), null, "application/vnd.github.squirrel-girl-preview+json", options); + connection.Received().GetAll(Arg.Is(u => u.ToString() == "repositories/1/issues/comments/42/reactions"), null, options); } [Fact] @@ -112,7 +112,7 @@ public void RequestsCorrectUrl() client.Create("fake", "repo", 1, newReaction); - connection.Received().Post(Arg.Is(u => u.ToString() == "repos/fake/repo/issues/comments/1/reactions"), newReaction, "application/vnd.github.squirrel-girl-preview+json"); + connection.Received().Post(Arg.Is(u => u.ToString() == "repos/fake/repo/issues/comments/1/reactions"), newReaction); } [Fact] @@ -125,7 +125,7 @@ public void RequestsCorrectUrlWithRepositoryId() client.Create(1, 1, newReaction); - connection.Received().Post(Arg.Is(u => u.ToString() == "repositories/1/issues/comments/1/reactions"), newReaction, "application/vnd.github.squirrel-girl-preview+json"); + connection.Received().Post(Arg.Is(u => u.ToString() == "repositories/1/issues/comments/1/reactions"), newReaction); } [Fact] diff --git a/Octokit.Tests/Clients/IssueCommentsClientTests.cs b/Octokit.Tests/Clients/IssueCommentsClientTests.cs index 4decf526c1..80373e6c62 100644 --- a/Octokit.Tests/Clients/IssueCommentsClientTests.cs +++ b/Octokit.Tests/Clients/IssueCommentsClientTests.cs @@ -24,8 +24,7 @@ public async Task RequestsCorrectUrl() connection.Received().Get( Arg.Is(u => u.ToString() == "repos/fake/repo/issues/comments/42"), - Arg.Any>(), - "application/vnd.github.squirrel-girl-preview+json"); + Arg.Any>()); } [Fact] @@ -37,8 +36,7 @@ public async Task RequestsCorrectUrlWithRepositoryId() await client.Get(1, 42); connection.Received().Get(Arg.Is(u => u.ToString() == "repositories/1/issues/comments/42"), - Arg.Any>(), - "application/vnd.github.squirrel-girl-preview+json"); + Arg.Any>()); } [Fact] @@ -67,7 +65,6 @@ public async Task RequestsCorrectUrl() connection.Received().GetAll( Arg.Is(u => u.ToString() == "repos/fake/repo/issues/comments"), Arg.Any>(), - "application/vnd.github.squirrel-girl-preview+json", Args.ApiOptions); } @@ -81,7 +78,6 @@ public async Task RequestsCorrectUrlWithRepositoryId() connection.Received().GetAll(Arg.Is(u => u.ToString() == "repositories/1/issues/comments"), Arg.Any>(), - "application/vnd.github.squirrel-girl-preview+json", Args.ApiOptions); } @@ -103,7 +99,6 @@ public async Task RequestsCorrectUrlWithApiOptions() connection.Received().GetAll( Arg.Is(u => u.ToString() == "repos/fake/repo/issues/comments"), Arg.Any>(), - "application/vnd.github.squirrel-girl-preview+json", options); } @@ -124,7 +119,6 @@ public async Task RequestsCorrectUrlWithRepositoryIdWithApiOptions() connection.Received().GetAll(Arg.Is(u => u.ToString() == "repositories/1/issues/comments"), Arg.Any>(), - "application/vnd.github.squirrel-girl-preview+json", options); } @@ -164,7 +158,6 @@ public async Task RequestsCorrectUrl() connection.Received().GetAll( Arg.Is(u => u.ToString() == "repos/fake/repo/issues/3/comments"), Arg.Any>(), - "application/vnd.github.squirrel-girl-preview+json", Args.ApiOptions); } @@ -178,7 +171,6 @@ public async Task RequestsCorrectUrlWithRepositoryId() connection.Received().GetAll(Arg.Is(u => u.ToString() == "repositories/1/issues/3/comments"), Arg.Any>(), - "application/vnd.github.squirrel-girl-preview+json", Args.ApiOptions); } @@ -198,7 +190,6 @@ public async Task RequestsCorrectUrlWithIssueCommentRequest() connection.Received().GetAll( Arg.Is(u => u.ToString() == "repos/fake/repo/issues/3/comments"), Arg.Any>(), - "application/vnd.github.squirrel-girl-preview+json", Args.ApiOptions); } @@ -217,7 +208,6 @@ public async Task RequestsCorrectUrlWithRepositoryIdWithIssueCommentRequest() connection.Received().GetAll(Arg.Is(u => u.ToString() == "repositories/1/issues/3/comments"), Arg.Any>(), - "application/vnd.github.squirrel-girl-preview+json", Args.ApiOptions); } @@ -239,7 +229,6 @@ public async Task RequestsCorrectUrlWithApiOptions() connection.Received().GetAll( Arg.Is(u => u.ToString() == "repos/fake/repo/issues/3/comments"), Arg.Any>(), - "application/vnd.github.squirrel-girl-preview+json", options); } @@ -260,7 +249,6 @@ public async Task RequestsCorrectUrlWithRepositoryIdWithApiOptions() connection.Received().GetAll(Arg.Is(u => u.ToString() == "repositories/1/issues/3/comments"), Arg.Any>(), - "application/vnd.github.squirrel-girl-preview+json", options); } diff --git a/Octokit.Tests/Clients/IssueReactionsClientTests.cs b/Octokit.Tests/Clients/IssueReactionsClientTests.cs index 8d4787077b..4b891d9e83 100644 --- a/Octokit.Tests/Clients/IssueReactionsClientTests.cs +++ b/Octokit.Tests/Clients/IssueReactionsClientTests.cs @@ -26,7 +26,7 @@ public async Task RequestsCorrectUrl() await client.GetAll("fake", "repo", 42); - connection.Received().GetAll(Arg.Is(u => u.ToString() == "repos/fake/repo/issues/42/reactions"), null, "application/vnd.github.squirrel-girl-preview+json", Args.ApiOptions); + connection.Received().GetAll(Arg.Is(u => u.ToString() == "repos/fake/repo/issues/42/reactions"), null, Args.ApiOptions); } [Fact] @@ -44,7 +44,7 @@ public async Task RequestsCorrectUrlApiOptions() await client.GetAll("fake", "repo", 42, options); - connection.Received().GetAll(Arg.Is(u => u.ToString() == "repos/fake/repo/issues/42/reactions"), null, "application/vnd.github.squirrel-girl-preview+json", options); + connection.Received().GetAll(Arg.Is(u => u.ToString() == "repos/fake/repo/issues/42/reactions"), null, options); } [Fact] @@ -55,7 +55,7 @@ public async Task RequestsCorrectUrlWithRepositoryId() await client.GetAll(1, 42); - connection.Received().GetAll(Arg.Is(u => u.ToString() == "repositories/1/issues/42/reactions"), null, "application/vnd.github.squirrel-girl-preview+json", Args.ApiOptions); + connection.Received().GetAll(Arg.Is(u => u.ToString() == "repositories/1/issues/42/reactions"), null, Args.ApiOptions); } [Fact] @@ -73,7 +73,7 @@ public async Task RequestsCorrectUrlWithRepositoryIdApiOptions() await client.GetAll(1, 42, options); - connection.Received().GetAll(Arg.Is(u => u.ToString() == "repositories/1/issues/42/reactions"), null, "application/vnd.github.squirrel-girl-preview+json", options); + connection.Received().GetAll(Arg.Is(u => u.ToString() == "repositories/1/issues/42/reactions"), null, options); } [Fact] @@ -112,7 +112,7 @@ public void RequestsCorrectUrl() client.Create("fake", "repo", 1, newReaction); - connection.Received().Post(Arg.Is(u => u.ToString() == "repos/fake/repo/issues/1/reactions"), newReaction, "application/vnd.github.squirrel-girl-preview+json"); + connection.Received().Post(Arg.Is(u => u.ToString() == "repos/fake/repo/issues/1/reactions"), newReaction); } [Fact] @@ -125,7 +125,7 @@ public void RequestsCorrectUrlWithRepositoryId() client.Create(1, 1, newReaction); - connection.Received().Post(Arg.Is(u => u.ToString() == "repositories/1/issues/1/reactions"), newReaction, "application/vnd.github.squirrel-girl-preview+json"); + connection.Received().Post(Arg.Is(u => u.ToString() == "repositories/1/issues/1/reactions"), newReaction); } [Fact] diff --git a/Octokit.Tests/Clients/IssueTimelineClientTests.cs b/Octokit.Tests/Clients/IssueTimelineClientTests.cs index 083f7fcd38..a22d961ef3 100644 --- a/Octokit.Tests/Clients/IssueTimelineClientTests.cs +++ b/Octokit.Tests/Clients/IssueTimelineClientTests.cs @@ -31,7 +31,6 @@ public async Task RequestsTheCorrectUrl() connection.Received().GetAll( Arg.Is(u => u.ToString() == "repos/fake/repo/issues/42/timeline"), Arg.Any>(), - "application/vnd.github.mockingbird-preview+json,application/vnd.github.starfox-preview+json", Arg.Any()); } @@ -46,7 +45,6 @@ public async Task RequestsTheCorrectUrlWithApiOptions() connection.Received().GetAll( Arg.Is(u => u.ToString() == "repos/fake/repo/issues/42/timeline"), Arg.Any>(), - "application/vnd.github.mockingbird-preview+json,application/vnd.github.starfox-preview+json", Arg.Is(ao => ao.PageSize == 30)); } @@ -61,7 +59,6 @@ public async Task RequestsTheCorrectUrlWithRepositoryId() connection.Received().GetAll( Arg.Is(u => u.ToString() == "repositories/1/issues/42/timeline"), Arg.Any>(), - "application/vnd.github.mockingbird-preview+json,application/vnd.github.starfox-preview+json", Arg.Any()); } @@ -76,7 +73,6 @@ public async Task RequestsTheCorrectUrlWithRepositoryIdAndApiOptions() connection.Received().GetAll( Arg.Is(u => u.ToString() == "repositories/1/issues/42/timeline"), Arg.Any>(), - "application/vnd.github.mockingbird-preview+json,application/vnd.github.starfox-preview+json", Arg.Is(ao => ao.PageSize == 30)); } diff --git a/Octokit.Tests/Clients/IssuesClientTests.cs b/Octokit.Tests/Clients/IssuesClientTests.cs index d30b518c31..5eaceb81d7 100644 --- a/Octokit.Tests/Clients/IssuesClientTests.cs +++ b/Octokit.Tests/Clients/IssuesClientTests.cs @@ -23,8 +23,7 @@ public async Task RequestsCorrectUrl() await client.Get("fake", "repo", 42); connection.Received().Get(Arg.Is(u => u.ToString() == "repos/fake/repo/issues/42"), - Arg.Any>(), - "application/vnd.github.squirrel-girl-preview+json"); + Arg.Any>()); } [Fact] @@ -36,8 +35,7 @@ public async Task RequestsCorrectUrlWithRepositoryId() await client.Get(1, 42); connection.Received().Get(Arg.Is(u => u.ToString() == "repositories/1/issues/42"), - Arg.Any>(), - "application/vnd.github.squirrel-girl-preview+json"); + Arg.Any>()); } [Fact] @@ -76,7 +74,6 @@ public async Task RequestsCorrectUrl() connection.Received().GetAll(Arg.Is(u => u.ToString() == "issues"), Arg.Any>(), - "application/vnd.github.squirrel-girl-preview+json", Args.ApiOptions); } @@ -94,7 +91,6 @@ public async Task SendsAppropriateParameters() && d["sort"] == "created" && d["state"] == "open" && d["direction"] == "asc"), - "application/vnd.github.squirrel-girl-preview+json", Args.ApiOptions); } } @@ -122,7 +118,6 @@ public async Task RequestsCorrectUrl() connection.Received().GetAll(Arg.Is(u => u.ToString() == "user/issues"), Arg.Any>(), - "application/vnd.github.squirrel-girl-preview+json", Args.ApiOptions); } } @@ -164,7 +159,6 @@ public async Task RequestsCorrectUrl() connection.Received().GetAll(Arg.Is(u => u.ToString() == "orgs/fake/issues"), Arg.Any>(), - "application/vnd.github.squirrel-girl-preview+json", Args.ApiOptions); } @@ -185,7 +179,6 @@ public void SendsAppropriateParameters() && d["direction"] == "asc" && d["sort"] == "created" && d["filter"] == "assigned"), - "application/vnd.github.squirrel-girl-preview+json", Args.ApiOptions); } } @@ -238,7 +231,6 @@ public async Task RequestsCorrectUrl() connection.Received().GetAll(Arg.Is(u => u.ToString() == "repos/fake/repo/issues"), Arg.Any>(), - "application/vnd.github.squirrel-girl-preview+json", Args.ApiOptions); } @@ -252,7 +244,6 @@ public async Task RequestsCorrectUrlWithRepositoryId() connection.Received().GetAll(Arg.Is(u => u.ToString() == "repositories/1/issues"), Arg.Any>(), - "application/vnd.github.squirrel-girl-preview+json", Args.ApiOptions); } @@ -273,7 +264,6 @@ public async Task RequestsCorrectUrlWithApiOptions() connection.Received().GetAll(Arg.Is(u => u.ToString() == "repos/fake/repo/issues"), Arg.Any>(), - "application/vnd.github.squirrel-girl-preview+json", options); } @@ -294,7 +284,6 @@ public async Task RequestsCorrectUrlWithRepositoryIdWithApiOptions() connection.Received().GetAll(Arg.Is(u => u.ToString() == "repositories/1/issues"), Arg.Any>(), - "application/vnd.github.squirrel-girl-preview+json", options); } @@ -315,7 +304,6 @@ public async Task SendsAppropriateParameters() && d["direction"] == "asc" && d["sort"] == "created" && d["filter"] == "assigned"), - "application/vnd.github.squirrel-girl-preview+json", Args.ApiOptions); } @@ -336,7 +324,6 @@ public async Task SendsAppropriateParametersWithRepositoryId() && d["direction"] == "asc" && d["sort"] == "created" && d["filter"] == "assigned"), - "application/vnd.github.squirrel-girl-preview+json", Args.ApiOptions); } @@ -364,7 +351,6 @@ public async Task SendsAppropriateParametersWithApiOptions() && d["direction"] == "asc" && d["sort"] == "created" && d["filter"] == "assigned"), - "application/vnd.github.squirrel-girl-preview+json", options); } @@ -392,7 +378,6 @@ public async Task SendsAppropriateParametersWithRepositoryIdWithApiOptions() && d["direction"] == "asc" && d["sort"] == "created" && d["filter"] == "assigned"), - "application/vnd.github.squirrel-girl-preview+json", options); } } diff --git a/Octokit.Tests/Clients/IssuesEventsClientTests.cs b/Octokit.Tests/Clients/IssuesEventsClientTests.cs index 6ad2ccc85e..db09ae1d64 100644 --- a/Octokit.Tests/Clients/IssuesEventsClientTests.cs +++ b/Octokit.Tests/Clients/IssuesEventsClientTests.cs @@ -26,7 +26,7 @@ public async Task RequestsCorrectUrl() var client = new IssuesEventsClient(connection); await client.GetAllForIssue("fake", "repo", 42); - connection.Received().GetAll(Arg.Is(u => u.ToString() == "repos/fake/repo/issues/42/events"), null, "application/vnd.github.starfox-preview+json", Args.ApiOptions); + connection.Received().GetAll(Arg.Is(u => u.ToString() == "repos/fake/repo/issues/42/events"), null, Args.ApiOptions); } [Fact] @@ -37,7 +37,7 @@ public async Task RequestsCorrectUrlWithRepositoryId() await client.GetAllForIssue(1, 42); - connection.Received().GetAll(Arg.Is(u => u.ToString() == "repositories/1/issues/42/events"), null, "application/vnd.github.starfox-preview+json", Args.ApiOptions); + connection.Received().GetAll(Arg.Is(u => u.ToString() == "repositories/1/issues/42/events"), null, Args.ApiOptions); } [Fact] @@ -55,7 +55,7 @@ public async Task RequestsCorrectUrlWithApiOptions() await client.GetAllForIssue("fake", "repo", 42, options); - connection.Received().GetAll(Arg.Is(u => u.ToString() == "repos/fake/repo/issues/42/events"), null, "application/vnd.github.starfox-preview+json", options); + connection.Received().GetAll(Arg.Is(u => u.ToString() == "repos/fake/repo/issues/42/events"), null, options); } [Fact] @@ -73,7 +73,7 @@ public async Task RequestsCorrectUrlWithRepositoryIdWithApiOptions() await client.GetAllForIssue(1, 42, options); - connection.Received().GetAll(Arg.Is(u => u.ToString() == "repositories/1/issues/42/events"), null, "application/vnd.github.starfox-preview+json", options); + connection.Received().GetAll(Arg.Is(u => u.ToString() == "repositories/1/issues/42/events"), null, options); } [Fact] @@ -106,7 +106,7 @@ public async Task RequestsCorrectUrl() await client.GetAllForRepository("fake", "repo"); - connection.Received().GetAll(Arg.Is(u => u.ToString() == "repos/fake/repo/issues/events"), null, "application/vnd.github.starfox-preview+json", Args.ApiOptions); + connection.Received().GetAll(Arg.Is(u => u.ToString() == "repos/fake/repo/issues/events"), null, Args.ApiOptions); } [Fact] @@ -117,7 +117,7 @@ public async Task RequestsCorrectUrlWithRepositoryId() await client.GetAllForRepository(1); - connection.Received().GetAll(Arg.Is(u => u.ToString() == "repositories/1/issues/events"), null, "application/vnd.github.starfox-preview+json", Args.ApiOptions); + connection.Received().GetAll(Arg.Is(u => u.ToString() == "repositories/1/issues/events"), null, Args.ApiOptions); } [Fact] @@ -135,7 +135,7 @@ public async Task RequestsCorrectUrlWithApiOptions() await client.GetAllForRepository("fake", "repo", options); - connection.Received().GetAll(Arg.Is(u => u.ToString() == "repos/fake/repo/issues/events"), null, "application/vnd.github.starfox-preview+json", options); + connection.Received().GetAll(Arg.Is(u => u.ToString() == "repos/fake/repo/issues/events"), null, options); } [Fact] @@ -153,7 +153,7 @@ public async Task RequestsCorrectUrlWithRepositoryIdWithApiOptions() await client.GetAllForRepository(1, options); - connection.Received().GetAll(Arg.Is(u => u.ToString() == "repositories/1/issues/events"), null, "application/vnd.github.starfox-preview+json", options); + connection.Received().GetAll(Arg.Is(u => u.ToString() == "repositories/1/issues/events"), null, options); } [Fact] @@ -186,7 +186,7 @@ public void RequestsCorrectUrl() client.Get("fake", "repo", 42); - connection.Received().Get(Arg.Is(u => u.ToString() == "repos/fake/repo/issues/events/42"), null, "application/vnd.github.starfox-preview+json"); + connection.Received().Get(Arg.Is(u => u.ToString() == "repos/fake/repo/issues/events/42"), null); } [Fact] @@ -197,7 +197,7 @@ public void RequestsCorrectUrlWithRepositoryId() client.Get(1, 42); - connection.Received().Get(Arg.Is(u => u.ToString() == "repositories/1/issues/events/42"), null, "application/vnd.github.starfox-preview+json"); + connection.Received().Get(Arg.Is(u => u.ToString() == "repositories/1/issues/events/42"), null); } [Fact] diff --git a/Octokit.Tests/Clients/MigrationsClientTests.cs b/Octokit.Tests/Clients/MigrationsClientTests.cs index 5556659858..26d71d16d8 100644 --- a/Octokit.Tests/Clients/MigrationsClientTests.cs +++ b/Octokit.Tests/Clients/MigrationsClientTests.cs @@ -30,8 +30,7 @@ public void RequestsCorrectUrl() connection.Received().Get( Arg.Is(u => u.ToString() == "orgs/fake/migrations/69"), - null, - "application/vnd.github.wyandotte-preview+json"); + null); } [Fact] @@ -58,7 +57,6 @@ public void RequestsCorrectUrl() connection.Received().GetAll( Arg.Is(u => u.ToString() == "orgs/fake/migrations"), null, - "application/vnd.github.wyandotte-preview+json", Args.ApiOptions); } @@ -79,7 +77,6 @@ public void RequestsCorrectUrlApiOptions() connection.Received().GetAll( Arg.Is(u => u.ToString() == "orgs/fake/migrations"), null, - "application/vnd.github.wyandotte-preview+json", options); } @@ -108,8 +105,7 @@ public void RequestsCorrectUrl() connection.Received().Post( Arg.Is(u => u.ToString() == "orgs/fake/migrations"), - Arg.Any(), - "application/vnd.github.wyandotte-preview+json"); + Arg.Any()); } [Fact] @@ -141,8 +137,7 @@ public void PassesRequestBody() Arg.Is(m => m.Repositories.Equals(migrationRequest.Repositories) && m.LockRepositories == migrationRequest.LockRepositories && - m.ExcludeAttachments == migrationRequest.ExcludeAttachments), - "application/vnd.github.wyandotte-preview+json"); + m.ExcludeAttachments == migrationRequest.ExcludeAttachments)); } } @@ -156,10 +151,8 @@ public void RequestsCorrectUrl() client.GetArchive("fake", 69); - connection.Connection.Received().Get( - Arg.Is(u => u.ToString() == "orgs/fake/migrations/69/archive"), - null, - "application/vnd.github.wyandotte-preview+json"); + connection.Connection.Received().GetRaw( + Arg.Is(u => u.ToString() == "orgs/fake/migrations/69/archive"), null); } [Fact] @@ -185,8 +178,7 @@ public void RequestsCorrectUrl() connection.Received().Delete( Arg.Is(u => u.ToString() == "orgs/fake/migrations/69/archive"), - Arg.Any(), - "application/vnd.github.wyandotte-preview+json"); + Arg.Any()); } [Fact] @@ -212,8 +204,7 @@ public void RequestsCorrectUrl() connection.Received().Delete( Arg.Is(u => u.ToString() == "orgs/fake/migrations/69/repos/repo/lock"), - Arg.Any(), - "application/vnd.github.wyandotte-preview+json"); + Arg.Any()); } [Fact] diff --git a/Octokit.Tests/Clients/OrganizationMembersClientTests.cs b/Octokit.Tests/Clients/OrganizationMembersClientTests.cs index d81e6d257c..e920dcb2f2 100644 --- a/Octokit.Tests/Clients/OrganizationMembersClientTests.cs +++ b/Octokit.Tests/Clients/OrganizationMembersClientTests.cs @@ -597,7 +597,7 @@ public void RequestsTheCorrectUrl() client.GetAllPendingInvitations("org"); - connection.Received().GetAll(Arg.Is(u => u.ToString() == "orgs/org/invitations"), null, "application/vnd.github.korra-preview+json", Args.ApiOptions); + connection.Received().GetAll(Arg.Is(u => u.ToString() == "orgs/org/invitations"), null, Args.ApiOptions); } [Fact] @@ -612,7 +612,7 @@ public void RequestsTheCorrectUrlWithApiOptions() }; client.GetAllPendingInvitations("org", options); - connection.Received().GetAll(Arg.Is(u => u.ToString() == "orgs/org/invitations"), null, "application/vnd.github.korra-preview+json", options); + connection.Received().GetAll(Arg.Is(u => u.ToString() == "orgs/org/invitations"), null, options); } [Fact] diff --git a/Octokit.Tests/Clients/OrganizationOutsideCollaboratorsClientTests.cs b/Octokit.Tests/Clients/OrganizationOutsideCollaboratorsClientTests.cs index beffb970be..7d503b5e32 100644 --- a/Octokit.Tests/Clients/OrganizationOutsideCollaboratorsClientTests.cs +++ b/Octokit.Tests/Clients/OrganizationOutsideCollaboratorsClientTests.cs @@ -26,7 +26,7 @@ public void RequestsTheCorrectUrl() client.GetAll("org"); - connection.Received().GetAll(Arg.Is(u => u.ToString() == "orgs/org/outside_collaborators"), null, "application/vnd.github.korra-preview+json", Args.ApiOptions); + connection.Received().GetAll(Arg.Is(u => u.ToString() == "orgs/org/outside_collaborators"), null, Args.ApiOptions); } [Fact] @@ -44,7 +44,7 @@ public void RequestsTheCorrectUrlWithApiOptions() client.GetAll("org", options); - connection.Received().GetAll(Arg.Is(u => u.ToString() == "orgs/org/outside_collaborators"), null, "application/vnd.github.korra-preview+json", options); + connection.Received().GetAll(Arg.Is(u => u.ToString() == "orgs/org/outside_collaborators"), null, options); } [Fact] @@ -76,7 +76,7 @@ public void AllFilterRequestsTheCorrectUrl() client.GetAll("org", OrganizationMembersFilter.All); - connection.Received().GetAll(Arg.Is(u => u.ToString() == "orgs/org/outside_collaborators?filter=all"), null, "application/vnd.github.korra-preview+json", Args.ApiOptions); + connection.Received().GetAll(Arg.Is(u => u.ToString() == "orgs/org/outside_collaborators?filter=all"), null, Args.ApiOptions); } [Fact] @@ -94,7 +94,7 @@ public void AllFilterRequestsTheCorrectUrlWithApiOptions() client.GetAll("org", OrganizationMembersFilter.All, options); - connection.Received().GetAll(Arg.Is(u => u.ToString() == "orgs/org/outside_collaborators?filter=all"), null, "application/vnd.github.korra-preview+json", options); + connection.Received().GetAll(Arg.Is(u => u.ToString() == "orgs/org/outside_collaborators?filter=all"), null, options); } [Fact] @@ -105,7 +105,7 @@ public void TwoFactorFilterRequestsTheCorrectUrl() client.GetAll("org", OrganizationMembersFilter.TwoFactorAuthenticationDisabled); - connection.Received().GetAll(Arg.Is(u => u.ToString() == "orgs/org/outside_collaborators?filter=2fa_disabled"), null, "application/vnd.github.korra-preview+json", Args.ApiOptions); + connection.Received().GetAll(Arg.Is(u => u.ToString() == "orgs/org/outside_collaborators?filter=2fa_disabled"), null, Args.ApiOptions); } [Fact] @@ -123,7 +123,7 @@ public void TwoFactorFilterRequestsTheCorrectUrlWithApiOptions() client.GetAll("org", OrganizationMembersFilter.TwoFactorAuthenticationDisabled, options); - connection.Received().GetAll(Arg.Is(u => u.ToString() == "orgs/org/outside_collaborators?filter=2fa_disabled"), null, "application/vnd.github.korra-preview+json", options); + connection.Received().GetAll(Arg.Is(u => u.ToString() == "orgs/org/outside_collaborators?filter=2fa_disabled"), null, options); } } @@ -137,10 +137,7 @@ public void RequestsTheCorrectUrl() client.Delete("org", "user"); - connection.Connection.Received().Delete( - Arg.Is(u => u.ToString() == "orgs/org/outside_collaborators/user"), - Arg.Any(), - "application/vnd.github.korra-preview+json"); + connection.Connection.Received().Delete(Arg.Is(u => u.ToString() == "orgs/org/outside_collaborators/user")); } [Fact] @@ -166,9 +163,7 @@ public void RequestsTheCorrectUrl() client.ConvertFromMember("org", "user"); - connection.Connection.Received().Put( - Arg.Is(u => u.ToString() == "orgs/org/outside_collaborators/user"), - "application/vnd.github.korra-preview+json"); + connection.Connection.Received().Put(Arg.Is(u => u.ToString() == "orgs/org/outside_collaborators/user")); } [Fact] diff --git a/Octokit.Tests/Clients/ProjectCardsClientTests.cs b/Octokit.Tests/Clients/ProjectCardsClientTests.cs index 20d1b6eb0a..b0cceb2440 100644 --- a/Octokit.Tests/Clients/ProjectCardsClientTests.cs +++ b/Octokit.Tests/Clients/ProjectCardsClientTests.cs @@ -30,7 +30,6 @@ public async Task RequestCorrectURL() connection.Received().GetAll( Arg.Is(u => u.ToString() == "projects/columns/1/cards"), Args.EmptyDictionary, - "application/vnd.github.inertia-preview+json", Args.ApiOptions); } @@ -47,7 +46,6 @@ public async Task SendsAppropriateParameters() Arg.Is>(x => x.Count == 1 && x["archived_state"] == "not_archived"), - "application/vnd.github.inertia-preview+json", Args.ApiOptions); } @@ -76,8 +74,7 @@ public async Task RequestCorrectURL() connection.Received().Get( Arg.Is(u => u.ToString() == "projects/columns/cards/1"), - null, - "application/vnd.github.inertia-preview+json"); + null); } } @@ -94,8 +91,7 @@ public async Task PostsToCorrectURL() connection.Received().Post( Arg.Is(u => u.ToString() == "projects/columns/1/cards"), - newCard, - "application/vnd.github.inertia-preview+json"); + newCard); } [Fact] @@ -124,8 +120,7 @@ public async Task PostsToCorrectURL() connection.Received().Patch( Arg.Is(u => u.ToString() == "projects/columns/cards/1"), - updateCard, - "application/vnd.github.inertia-preview+json"); + updateCard); } [Fact] @@ -153,8 +148,7 @@ public async Task DeletesCorrectURL() connection.Connection.Received().Delete( Arg.Is(u => u.ToString() == "projects/columns/cards/1"), - Arg.Any(), - "application/vnd.github.inertia-preview+json"); + Arg.Any()); } } @@ -172,7 +166,7 @@ public async Task PostsToCorrectURL() connection.Connection.Received().Post( Arg.Is(u => u.ToString() == "projects/columns/cards/1/moves"), position, - "application/vnd.github.inertia-preview+json"); + null); } [Fact] diff --git a/Octokit.Tests/Clients/ProjectColumnsClientTests.cs b/Octokit.Tests/Clients/ProjectColumnsClientTests.cs index 7eb3c8fb99..e366b2947b 100644 --- a/Octokit.Tests/Clients/ProjectColumnsClientTests.cs +++ b/Octokit.Tests/Clients/ProjectColumnsClientTests.cs @@ -30,7 +30,6 @@ public async Task RequestCorrectURL() connection.Received().GetAll( Arg.Is(u => u.ToString() == "projects/1/columns"), Args.EmptyDictionary, - "application/vnd.github.inertia-preview+json", Args.ApiOptions); } @@ -55,8 +54,7 @@ public async Task RequestCorrectURL() connection.Received().Get( Arg.Is(u => u.ToString() == "projects/columns/1"), - null, - "application/vnd.github.inertia-preview+json"); + null); } } @@ -73,8 +71,7 @@ public async Task PostsToCorrectURL() connection.Received().Post( Arg.Is(u => u.ToString() == "projects/1/columns"), - newProjectColumn, - "application/vnd.github.inertia-preview+json"); + newProjectColumn); } [Fact] @@ -100,8 +97,7 @@ public async Task PostsToCorrectURL() connection.Received().Patch( Arg.Is(u => u.ToString() == "projects/columns/1"), - updateProjectColumn, - "application/vnd.github.inertia-preview+json"); + updateProjectColumn); } [Fact] @@ -125,8 +121,7 @@ public async Task DeletesCorrectURL() connection.Connection.Received().Delete( Arg.Is(u => u.ToString() == "projects/columns/1"), - Arg.Any(), - "application/vnd.github.inertia-preview+json"); + Arg.Any()); } } @@ -144,7 +139,7 @@ public async Task PostsToCorrectURL() connection.Connection.Received().Post( Arg.Is(u => u.ToString() == "projects/columns/1/moves"), position, - "application/vnd.github.inertia-preview+json"); + null); } [Fact] diff --git a/Octokit.Tests/Clients/ProjectsClientTests.cs b/Octokit.Tests/Clients/ProjectsClientTests.cs index f723667d92..2f06979234 100644 --- a/Octokit.Tests/Clients/ProjectsClientTests.cs +++ b/Octokit.Tests/Clients/ProjectsClientTests.cs @@ -31,7 +31,6 @@ public async Task RequestCorrectUrl() connection.Received().GetAll( Arg.Is(u => u.ToString() == "repos/owner/repo/projects"), Args.EmptyDictionary, - "application/vnd.github.inertia-preview+json", Args.ApiOptions); } @@ -46,7 +45,6 @@ public async Task RequestCorrectUrlWithRequestParameter() connection.Received().GetAll( Arg.Is(u => u.ToString() == "repos/owner/repo/projects"), Arg.Is>(d => d.ContainsKey("state")), - "application/vnd.github.inertia-preview+json", Args.ApiOptions); } @@ -61,7 +59,6 @@ public async Task RequestCorrectUrlWithRepositoryId() connection.Received().GetAll( Arg.Is(u => u.ToString() == "repositories/1/projects"), Args.EmptyDictionary, - "application/vnd.github.inertia-preview+json", Args.ApiOptions); } @@ -76,7 +73,6 @@ public async Task RequestCorrectUrlWithRequestParameterWithRepositoryId() connection.Received().GetAll( Arg.Is(u => u.ToString() == "repositories/1/projects"), Arg.Is>(d => d.ContainsKey("state")), - "application/vnd.github.inertia-preview+json", Args.ApiOptions); } @@ -126,7 +122,6 @@ public async Task RequestCorrectUrl() connection.Received().GetAll( Arg.Is(u => u.ToString() == "orgs/org/projects"), Args.EmptyDictionary, - "application/vnd.github.inertia-preview+json", Args.ApiOptions); } @@ -141,7 +136,6 @@ public async Task RequestCorrectUrlWithRequestParameter() connection.Received().GetAll( Arg.Is(u => u.ToString() == "orgs/org/projects"), Arg.Is>(d => d.ContainsKey("state")), - "application/vnd.github.inertia-preview+json", Args.ApiOptions); } @@ -178,7 +172,7 @@ public async Task RequestCorrectURL() await client.Get(1); - connection.Received().Get(Arg.Is(u => u.ToString() == "projects/1"), null, "application/vnd.github.inertia-preview+json"); + connection.Received().Get(Arg.Is(u => u.ToString() == "projects/1"), null); } } @@ -193,7 +187,7 @@ public async Task PostsToCorrectURL() await client.CreateForRepository(1, newProject); - connection.Received().Post(Arg.Is(u => u.ToString() == "repositories/1/projects"), newProject, "application/vnd.github.inertia-preview+json"); + connection.Received().Post(Arg.Is(u => u.ToString() == "repositories/1/projects"), newProject); } [Fact] @@ -216,7 +210,7 @@ public async Task PostsToCorrectURL() await client.CreateForOrganization("org", newProject); - connection.Received().Post(Arg.Is(u => u.ToString() == "orgs/org/projects"), newProject, "application/vnd.github.inertia-preview+json"); + connection.Received().Post(Arg.Is(u => u.ToString() == "orgs/org/projects"), newProject); } [Fact] @@ -242,7 +236,7 @@ public async Task PostsToCorrectURL() await client.Update(1, updateProject); - connection.Received().Patch(Arg.Is(u => u.ToString() == "projects/1"), updateProject, "application/vnd.github.inertia-preview+json"); + connection.Received().Patch(Arg.Is(u => u.ToString() == "projects/1"), updateProject); } [Fact] @@ -264,7 +258,7 @@ public async Task DeletesCorrectUrl() await client.Delete(1); - connection.Connection.Received().Delete(Arg.Is(u => u.ToString() == "projects/1"), Arg.Any(), "application/vnd.github.inertia-preview+json"); + connection.Connection.Received().Delete(Arg.Is(u => u.ToString() == "projects/1"), Arg.Any()); } } } diff --git a/Octokit.Tests/Clients/PullRequestReviewCommentReactionsClientTests.cs b/Octokit.Tests/Clients/PullRequestReviewCommentReactionsClientTests.cs index 099f7aa9b1..063b14ea02 100644 --- a/Octokit.Tests/Clients/PullRequestReviewCommentReactionsClientTests.cs +++ b/Octokit.Tests/Clients/PullRequestReviewCommentReactionsClientTests.cs @@ -26,7 +26,7 @@ public async Task RequestsCorrectUrl() await client.GetAll("fake", "repo", 42); - connection.Received().GetAll(Arg.Is(u => u.ToString() == "repos/fake/repo/pulls/comments/42/reactions"), null, "application/vnd.github.squirrel-girl-preview+json", Args.ApiOptions); + connection.Received().GetAll(Arg.Is(u => u.ToString() == "repos/fake/repo/pulls/comments/42/reactions"), null, Args.ApiOptions); } [Fact] @@ -43,7 +43,7 @@ public async Task RequestsCorrectUrlApiOptions() await client.GetAll("fake", "repo", 42, options); - connection.Received().GetAll(Arg.Is(u => u.ToString() == "repos/fake/repo/pulls/comments/42/reactions"), null, "application/vnd.github.squirrel-girl-preview+json", options); + connection.Received().GetAll(Arg.Is(u => u.ToString() == "repos/fake/repo/pulls/comments/42/reactions"), null, options); } [Fact] @@ -54,7 +54,7 @@ public async Task RequestsCorrectUrlWithRepositoryId() await client.GetAll(1, 42); - connection.Received().GetAll(Arg.Is(u => u.ToString() == "repositories/1/pulls/comments/42/reactions"), null, "application/vnd.github.squirrel-girl-preview+json", Args.ApiOptions); + connection.Received().GetAll(Arg.Is(u => u.ToString() == "repositories/1/pulls/comments/42/reactions"), null, Args.ApiOptions); } [Fact] @@ -71,7 +71,7 @@ public async Task RequestsCorrectUrlWithRepositoryIdApiOptions() await client.GetAll(1, 42, options); - connection.Received().GetAll(Arg.Is(u => u.ToString() == "repositories/1/pulls/comments/42/reactions"), null, "application/vnd.github.squirrel-girl-preview+json", options); + connection.Received().GetAll(Arg.Is(u => u.ToString() == "repositories/1/pulls/comments/42/reactions"), null, options); } [Fact] @@ -110,7 +110,7 @@ public void RequestsCorrectUrl() client.Create("fake", "repo", 1, newReaction); - connection.Received().Post(Arg.Is(u => u.ToString() == "repos/fake/repo/pulls/comments/1/reactions"), newReaction, "application/vnd.github.squirrel-girl-preview+json"); + connection.Received().Post(Arg.Is(u => u.ToString() == "repos/fake/repo/pulls/comments/1/reactions"), newReaction); } [Fact] @@ -123,7 +123,7 @@ public void RequestsCorrectUrlWithRepositoryId() client.Create(1, 1, newReaction); - connection.Received().Post(Arg.Is(u => u.ToString() == "repositories/1/pulls/comments/1/reactions"), newReaction, "application/vnd.github.squirrel-girl-preview+json"); + connection.Received().Post(Arg.Is(u => u.ToString() == "repositories/1/pulls/comments/1/reactions"), newReaction); } [Fact] diff --git a/Octokit.Tests/Clients/PullRequestReviewCommentsClientTests.cs b/Octokit.Tests/Clients/PullRequestReviewCommentsClientTests.cs index 9b9c57b5e4..eae63b578a 100644 --- a/Octokit.Tests/Clients/PullRequestReviewCommentsClientTests.cs +++ b/Octokit.Tests/Clients/PullRequestReviewCommentsClientTests.cs @@ -99,8 +99,7 @@ public async Task RequestsCorrectUrl() connection.Received().GetAll( Arg.Is(u => u.ToString() == "repos/owner/name/pulls/7/comments"), - Arg.Any>(), - "application/vnd.github.squirrel-girl-preview+json", Args.ApiOptions); + Arg.Any>(), Args.ApiOptions); } [Fact] @@ -132,8 +131,7 @@ public async Task RequestsCorrectUrlWithApiOptions() connection.Received().GetAll( Arg.Is(u => u.ToString() == "repos/owner/name/pulls/7/comments"), - Arg.Any>(), - "application/vnd.github.squirrel-girl-preview+json", options); + Arg.Any>(), options); } [Fact] @@ -200,7 +198,6 @@ public async Task RequestsCorrectUrl() && d["direction"] == "desc" && d["since"] == "2013-11-15T11:43:01Z" && d["sort"] == "updated"), - "application/vnd.github.squirrel-girl-preview+json", Args.ApiOptions); } @@ -224,7 +221,7 @@ public async Task RequestsCorrectUrlWithRepositoryId() && d["direction"] == "desc" && d["since"] == "2013-11-15T11:43:01Z" && d["sort"] == "updated"), - "application/vnd.github.squirrel-girl-preview+json", Args.ApiOptions); + Args.ApiOptions); } [Fact] @@ -254,7 +251,6 @@ public async Task RequestsCorrectUrlWithApiOptions() && d["direction"] == "desc" && d["since"] == "2013-11-15T11:43:01Z" && d["sort"] == "updated"), - "application/vnd.github.squirrel-girl-preview+json", options); } @@ -285,7 +281,7 @@ public async Task RequestsCorrectUrlWithApiOptionsWithRepositoryId() && d["direction"] == "desc" && d["since"] == "2013-11-15T11:43:01Z" && d["sort"] == "updated"), - "application/vnd.github.squirrel-girl-preview+json", options); + options); } [Fact] @@ -300,7 +296,6 @@ public async Task RequestsCorrectUrlWithoutSelectedSortingArguments() Arg.Is>(d => d.Count == 2 && d["direction"] == "asc" && d["sort"] == "created"), - "application/vnd.github.squirrel-girl-preview+json", Args.ApiOptions); } @@ -316,7 +311,7 @@ public async Task RequestsCorrectUrlWithoutSelectedSortingArgumentsWithRepositor Arg.Is>(d => d.Count == 2 && d["direction"] == "asc" && d["sort"] == "created"), - "application/vnd.github.squirrel-girl-preview+json", Args.ApiOptions); + Args.ApiOptions); } [Fact] @@ -338,7 +333,6 @@ public async Task RequestsCorrectUrlWithoutSelectedSortingArgumentsWithApiOption Arg.Is>(d => d.Count == 2 && d["direction"] == "asc" && d["sort"] == "created"), - "application/vnd.github.squirrel-girl-preview+json", options); } @@ -361,7 +355,7 @@ public async Task RequestsCorrectUrlWithoutSelectedSortingArgumentsWithApiOption Arg.Is>(d => d.Count == 2 && d["direction"] == "asc" && d["sort"] == "created"), - "application/vnd.github.squirrel-girl-preview+json", options); + options); } [Fact] @@ -420,8 +414,7 @@ public void RequestsCorrectUrl() connection.Received().Get( Arg.Is(u => u.ToString() == "repos/owner/name/pulls/comments/53"), - Arg.Any>(), - "application/vnd.github.squirrel-girl-preview+json"); + Arg.Any>()); } [Fact] diff --git a/Octokit.Tests/Clients/PullRequestsClientTests.cs b/Octokit.Tests/Clients/PullRequestsClientTests.cs index ca0488fca9..2f10009ad5 100644 --- a/Octokit.Tests/Clients/PullRequestsClientTests.cs +++ b/Octokit.Tests/Clients/PullRequestsClientTests.cs @@ -18,7 +18,7 @@ public async Task RequestsCorrectUrl() await client.Get("fake", "repo", 42); - connection.Received().Get(Arg.Is(u => u.ToString() == "repos/fake/repo/pulls/42"), Arg.Any>(), "application/vnd.github.shadow-cat-preview+json"); + connection.Received().Get(Arg.Is(u => u.ToString() == "repos/fake/repo/pulls/42"), Arg.Any>()); } [Fact] @@ -29,7 +29,7 @@ public async Task RequestsCorrectUrlWithRepositoryId() await client.Get(1, 42); - connection.Received().Get(Arg.Is(u => u.ToString() == "repositories/1/pulls/42"), Arg.Any>(), "application/vnd.github.shadow-cat-preview+json"); + connection.Received().Get(Arg.Is(u => u.ToString() == "repositories/1/pulls/42"), Arg.Any>()); } [Fact] @@ -56,7 +56,7 @@ public async Task RequestsCorrectUrl() await client.GetAllForRepository("fake", "repo"); connection.Received().GetAll(Arg.Is(u => u.ToString() == "repos/fake/repo/pulls"), - Arg.Any>(), "application/vnd.github.shadow-cat-preview+json", Args.ApiOptions); + Arg.Any>(), Args.ApiOptions); } [Fact] @@ -68,7 +68,7 @@ public async Task RequestsCorrectUrlWithRepositoryId() await client.GetAllForRepository(1); connection.Received().GetAll(Arg.Is(u => u.ToString() == "repositories/1/pulls"), - Arg.Any>(), "application/vnd.github.shadow-cat-preview+json", Args.ApiOptions); + Arg.Any>(), Args.ApiOptions); } [Fact] @@ -87,7 +87,7 @@ public async Task RequestsCorrectUrlWithApiOptions() await client.GetAllForRepository("fake", "repo", options); connection.Received().GetAll(Arg.Is(u => u.ToString() == "repos/fake/repo/pulls"), - Arg.Any>(), "application/vnd.github.shadow-cat-preview+json", options); + Arg.Any>(), options); } [Fact] @@ -106,7 +106,7 @@ public async Task RequestsCorrectUrlWithApiOptionsWithRepositoryId() await client.GetAllForRepository(1, options); connection.Received().GetAll(Arg.Is(u => u.ToString() == "repositories/1/pulls"), - Arg.Any>(), "application/vnd.github.shadow-cat-preview+json", options); + Arg.Any>(), options); } [Fact] @@ -123,7 +123,7 @@ public async Task SendsAppropriateParameters() && d["state"] == "open" && d["base"] == "fake_base_branch" && d["sort"] == "created" - && d["direction"] == "desc"), "application/vnd.github.shadow-cat-preview+json", Args.ApiOptions); + && d["direction"] == "desc"), Args.ApiOptions); } [Fact] @@ -140,7 +140,7 @@ public async Task SendsAppropriateParametersWithRepositoryId() && d["state"] == "open" && d["base"] == "fake_base_branch" && d["sort"] == "created" - && d["direction"] == "desc"), "application/vnd.github.shadow-cat-preview+json", Args.ApiOptions); + && d["direction"] == "desc"), Args.ApiOptions); } [Fact] @@ -164,7 +164,7 @@ public async Task SendsAppropriateParametersWithApiOptions() && d["state"] == "open" && d["base"] == "fake_base_branch" && d["sort"] == "created" - && d["direction"] == "desc"), "application/vnd.github.shadow-cat-preview+json", options); + && d["direction"] == "desc"), options); } [Fact] @@ -188,7 +188,7 @@ public async Task SendsAppropriateParametersWithApiOptionsWithRepositoryId() && d["state"] == "open" && d["base"] == "fake_base_branch" && d["sort"] == "created" - && d["direction"] == "desc"), "application/vnd.github.shadow-cat-preview+json", options); + && d["direction"] == "desc"), options); } [Fact] @@ -243,7 +243,7 @@ public async Task PostsToCorrectUrl() await client.Create("fake", "repo", newPullRequest); connection.Received().Post(Arg.Is(u => u.ToString() == "repos/fake/repo/pulls"), - newPullRequest, "application/vnd.github.shadow-cat-preview+json"); + newPullRequest); } [Fact] @@ -256,7 +256,7 @@ public async Task PostsToCorrectUrlWithRepositoryId() await client.Create(1, newPullRequest); connection.Received().Post(Arg.Is(u => u.ToString() == "repositories/1/pulls"), - newPullRequest, "application/vnd.github.shadow-cat-preview+json"); + newPullRequest); } [Fact] @@ -288,7 +288,7 @@ public async Task PostsToCorrectUrl() await client.Update("fake", "repo", 42, pullRequestUpdate); connection.Received().Patch(Arg.Is(u => u.ToString() == "repos/fake/repo/pulls/42"), - pullRequestUpdate, "application/vnd.github.shadow-cat-preview+json"); + pullRequestUpdate); } [Fact] @@ -301,7 +301,7 @@ public async Task PostsToCorrectUrlWithRepositoryId() await client.Update(1, 42, pullRequestUpdate); connection.Received().Patch(Arg.Is(u => u.ToString() == "repositories/1/pulls/42"), - pullRequestUpdate, "application/vnd.github.shadow-cat-preview+json"); + pullRequestUpdate); } [Fact] diff --git a/Octokit.Tests/Clients/ReactionsClientTests.cs b/Octokit.Tests/Clients/ReactionsClientTests.cs index 681a077b51..6e311e53fe 100644 --- a/Octokit.Tests/Clients/ReactionsClientTests.cs +++ b/Octokit.Tests/Clients/ReactionsClientTests.cs @@ -26,7 +26,7 @@ public async Task DeletesCorrectUrl() await client.Delete(42); - connection.Received().Delete(Arg.Is(u => u.ToString() == "reactions/42"), Arg.Any(), "application/vnd.github.squirrel-girl-preview+json"); + connection.Received().Delete(Arg.Is(u => u.ToString() == "reactions/42"), Arg.Any()); } } } diff --git a/Octokit.Tests/Clients/RepoCollaboratorsClientTests.cs b/Octokit.Tests/Clients/RepoCollaboratorsClientTests.cs index c3177f51aa..f255388a83 100644 --- a/Octokit.Tests/Clients/RepoCollaboratorsClientTests.cs +++ b/Octokit.Tests/Clients/RepoCollaboratorsClientTests.cs @@ -303,8 +303,7 @@ public void RequestsCorrectUrl() client.ReviewPermission("owner", "test", "user1"); connection.Received().Get( Arg.Is(u => u.ToString() == "repos/owner/test/collaborators/user1/permission"), - Arg.Any>(), - "application/vnd.github.korra-preview+json"); + Arg.Any>()); } [Fact] @@ -316,8 +315,7 @@ public void RequestsCorrectUrlWithRepositoryId() client.ReviewPermission(1L, "user1"); connection.Received().Get( Arg.Is(u => u.ToString() == "repositories/1/collaborators/user1/permission"), - Arg.Any>(), - "application/vnd.github.korra-preview+json"); + Arg.Any>()); } [Fact] diff --git a/Octokit.Tests/Clients/RepositoriesClientTests.cs b/Octokit.Tests/Clients/RepositoriesClientTests.cs index 9d95cd1cee..e8e33b45d0 100644 --- a/Octokit.Tests/Clients/RepositoriesClientTests.cs +++ b/Octokit.Tests/Clients/RepositoriesClientTests.cs @@ -44,8 +44,7 @@ public void UsesTheUserReposUrl() client.Create(new NewRepository("aName")); connection.Received().Post(Arg.Is(u => u.ToString() == "user/repos"), - Arg.Any(), - "application/vnd.github.nebula-preview+json,application/vnd.github.baptiste-preview+json"); + Arg.Any()); } [Fact] @@ -57,7 +56,7 @@ public void TheNewRepositoryDescription() client.Create(newRepository); - connection.Received().Post(Args.Uri, newRepository, "application/vnd.github.nebula-preview+json,application/vnd.github.baptiste-preview+json"); + connection.Received().Post(Args.Uri, newRepository); } [Fact] @@ -73,7 +72,7 @@ public async Task ThrowsRepositoryExistsExceptionWhenRepositoryExistsForCurrentU var connection = Substitute.For(); connection.Connection.BaseAddress.Returns(GitHubClient.GitHubApiUrl); connection.Connection.Credentials.Returns(credentials); - connection.Post(Args.Uri, newRepository, "application/vnd.github.nebula-preview+json,application/vnd.github.baptiste-preview+json") + connection.Post(Args.Uri, newRepository) .Returns>(_ => { throw new ApiValidationException(response); }); var client = new RepositoriesClient(connection); @@ -100,7 +99,7 @@ public async Task ThrowsExceptionWhenPrivateRepositoryQuotaExceeded() var connection = Substitute.For(); connection.Connection.BaseAddress.Returns(GitHubClient.GitHubApiUrl); connection.Connection.Credentials.Returns(credentials); - connection.Post(Args.Uri, newRepository, "application/vnd.github.nebula-preview+json,application/vnd.github.baptiste-preview+json") + connection.Post(Args.Uri, newRepository) .Returns>(_ => { throw new ApiValidationException(response); }); var client = new RepositoriesClient(connection); @@ -132,8 +131,7 @@ public async Task UsesTheOrganizationsReposUrl() connection.Received().Post( Arg.Is(u => u.ToString() == "orgs/theLogin/repos"), - Args.NewRepository, - "application/vnd.github.nebula-preview+json,application/vnd.github.baptiste-preview+json"); + Args.NewRepository); } [Fact] @@ -145,7 +143,7 @@ public async Task TheNewRepositoryDescription() await client.Create("aLogin", newRepository); - connection.Received().Post(Args.Uri, newRepository, "application/vnd.github.nebula-preview+json,application/vnd.github.baptiste-preview+json"); + connection.Received().Post(Args.Uri, newRepository); } [Fact] @@ -159,7 +157,7 @@ public async Task ThrowsRepositoryExistsExceptionWhenRepositoryExistsForSpecifie + @"""code"":""custom"",""field"":""name"",""message"":""name already exists on this account""}]}"); var connection = Substitute.For(); connection.Connection.BaseAddress.Returns(GitHubClient.GitHubApiUrl); - connection.Post(Args.Uri, newRepository, "application/vnd.github.nebula-preview+json,application/vnd.github.baptiste-preview+json") + connection.Post(Args.Uri, newRepository) .Returns>(_ => { throw new ApiValidationException(response); }); var client = new RepositoriesClient(connection); @@ -184,7 +182,7 @@ public async Task ThrowsValidationException() + @"""http://developer.github.com/v3/repos/#create"",""errors"":[]}"); var connection = Substitute.For(); connection.Connection.BaseAddress.Returns(GitHubClient.GitHubApiUrl); - connection.Post(Args.Uri, newRepository, "application/vnd.github.nebula-preview+json,application/vnd.github.baptiste-preview+json") + connection.Post(Args.Uri, newRepository) .Returns>(_ => { throw new ApiValidationException(response); }); var client = new RepositoriesClient(connection); @@ -205,7 +203,7 @@ public async Task ThrowsRepositoryExistsExceptionForEnterpriseInstance() + @"""code"":""custom"",""field"":""name"",""message"":""name already exists on this account""}]}"); var connection = Substitute.For(); connection.Connection.BaseAddress.Returns(new Uri("https://example.com")); - connection.Post(Args.Uri, newRepository, "application/vnd.github.nebula-preview+json,application/vnd.github.baptiste-preview+json") + connection.Post(Args.Uri, newRepository) .Returns>(_ => { throw new ApiValidationException(response); }); var client = new RepositoriesClient(connection); @@ -238,8 +236,7 @@ public void UsesTheUserReposUrl() client.Generate("asd", "asd", new NewRepositoryFromTemplate("aName")); connection.Received().Post(Arg.Is(u => u.ToString() == "repos/asd/asd/generate"), - Arg.Any(), - "application/vnd.github.baptiste-preview+json"); + Arg.Any()); } [Fact] @@ -251,7 +248,7 @@ public void TheNewRepositoryDescription() client.Generate("anOwner", "aRepo", newRepository); - connection.Received().Post(Args.Uri, newRepository, "application/vnd.github.baptiste-preview+json"); + connection.Received().Post(Args.Uri, newRepository); } } @@ -496,8 +493,7 @@ public async Task RequestsCorrectUrl() connection.Received() .Get(Arg.Is(u => u.ToString() == "repos/owner/name"), - null, - "application/vnd.github.nebula-preview+json"); + null); } [Fact] @@ -580,7 +576,6 @@ public async Task RequestsTheCorrectUrlAndReturnsRepositories() connection.Received() .GetAll(Arg.Is(u => u.ToString() == "user/repos"), null, - "application/vnd.github.nebula-preview+json,application/vnd.github.baptiste-preview+json", Args.ApiOptions); } @@ -601,7 +596,6 @@ public async Task CanFilterByType() .GetAll( Arg.Is(u => u.ToString() == "user/repos"), Arg.Is>(d => d["type"] == "all"), - "application/vnd.github.nebula-preview+json", Args.ApiOptions); } @@ -623,7 +617,6 @@ public async Task CanFilterBySort() .GetAll( Arg.Is(u => u.ToString() == "user/repos"), Arg.Is>(d => d["type"] == "private" && d["sort"] == "full_name"), - "application/vnd.github.nebula-preview+json", Args.ApiOptions); } @@ -646,7 +639,6 @@ public async Task CanFilterBySortDirection() .GetAll( Arg.Is(u => u.ToString() == "user/repos"), Arg.Is>(d => d["type"] == "member" && d["sort"] == "updated" && d["direction"] == "asc"), - "application/vnd.github.nebula-preview+json", Args.ApiOptions); } @@ -667,7 +659,6 @@ public async Task CanFilterByVisibility() .GetAll( Arg.Is(u => u.ToString() == "user/repos"), Arg.Is>(d => d["visibility"] == "private"), - "application/vnd.github.nebula-preview+json", Args.ApiOptions); } @@ -689,7 +680,6 @@ public async Task CanFilterByAffiliation() .GetAll( Arg.Is(u => u.ToString() == "user/repos"), Arg.Is>(d => d["affiliation"] == "owner" && d["sort"] == "full_name"), - "application/vnd.github.nebula-preview+json", Args.ApiOptions); } } @@ -734,7 +724,7 @@ public async Task RequestsTheCorrectUrl() await client.GetAllForOrg("orgname"); connection.Received() - .GetAll(Arg.Is(u => u.ToString() == "orgs/orgname/repos"), null, "application/vnd.github.nebula-preview+json,application/vnd.github.baptiste-preview+json", Args.ApiOptions); + .GetAll(Arg.Is(u => u.ToString() == "orgs/orgname/repos"), null, Args.ApiOptions); } [Fact] @@ -1167,8 +1157,7 @@ public void PatchesCorrectUrl() connection.Received() .Patch(Arg.Is(u => u.ToString() == "repos/owner/repo"), - Arg.Any(), - "application/vnd.github.nebula-preview+json,application/vnd.github.baptiste-preview+json"); + Arg.Any()); } [Fact] @@ -1338,7 +1327,7 @@ public void RequestsTheCorrectUrl() client.GetSha1("owner", "name", "reference"); connection.Received() - .Get(Arg.Is(u => u.ToString() == "repos/owner/name/commits/reference"), null, "application/vnd.github.v3.sha"); + .Get(Arg.Is(u => u.ToString() == "repos/owner/name/commits/reference"), null); } } @@ -1371,7 +1360,7 @@ public void RequestsTheCorrectUrlForOwnerAndRepo() client.GetAllTopics("owner", "name"); connection.Received() - .Get(Arg.Is(u => u.ToString() == "repos/owner/name/topics"), null, "application/vnd.github.mercy-preview+json"); + .Get(Arg.Is(u => u.ToString() == "repos/owner/name/topics"), null); } [Fact] @@ -1383,7 +1372,7 @@ public void RequestsTheCorrectUrlForRepoId() client.GetAllTopics(1234); connection.Received() - .Get(Arg.Is(u => u.ToString() == "repositories/1234/topics"), null, "application/vnd.github.mercy-preview+json"); + .Get(Arg.Is(u => u.ToString() == "repositories/1234/topics"), null); } } @@ -1422,7 +1411,7 @@ public async Task RequestsTheCorrectUrlForOwnerAndRepoWithEmptyTopics() await _client.ReplaceAllTopics("owner", "name", _emptyTopics); _connection.Received() - .Put(Arg.Is(u => u.ToString() == "repos/owner/name/topics"), _emptyTopics, null, "application/vnd.github.mercy-preview+json"); + .Put(Arg.Is(u => u.ToString() == "repos/owner/name/topics"), _emptyTopics, null); } [Fact] @@ -1431,7 +1420,7 @@ public async Task RequestsTheCorrectUrlForOwnerAndRepoWithListOfTopics() await _client.ReplaceAllTopics("owner", "name", _listOfTopics); _connection.Received() - .Put(Arg.Is(u => u.ToString() == "repos/owner/name/topics"), _listOfTopics, null, "application/vnd.github.mercy-preview+json"); + .Put(Arg.Is(u => u.ToString() == "repos/owner/name/topics"), _listOfTopics, null); } [Fact] @@ -1440,7 +1429,7 @@ public async Task RequestsTheCorrectUrlForRepoIdWithEmptyTopics() await _client.ReplaceAllTopics(1234, _emptyTopics); _connection.Received() - .Put(Arg.Is(u => u.ToString() == "repositories/1234/topics"), _emptyTopics, null, "application/vnd.github.mercy-preview+json"); + .Put(Arg.Is(u => u.ToString() == "repositories/1234/topics"), _emptyTopics, null); } [Fact] @@ -1449,7 +1438,7 @@ public async Task RequestsTheCorrectUrlForRepoIdWithListOfTopics() await _client.ReplaceAllTopics(1234, _listOfTopics); _connection.Received() - .Put(Arg.Is(u => u.ToString() == "repositories/1234/topics"), _listOfTopics, null, "application/vnd.github.mercy-preview+json"); + .Put(Arg.Is(u => u.ToString() == "repositories/1234/topics"), _listOfTopics, null); } } } diff --git a/Octokit.Tests/Clients/RepositoryBranchesClientTests.cs b/Octokit.Tests/Clients/RepositoryBranchesClientTests.cs index 267bf4e157..de8f42424e 100644 --- a/Octokit.Tests/Clients/RepositoryBranchesClientTests.cs +++ b/Octokit.Tests/Clients/RepositoryBranchesClientTests.cs @@ -33,7 +33,7 @@ public async Task RequestsTheCorrectUrl() await client.GetAll("owner", "name"); connection.Received() - .GetAll(Arg.Is(u => u.ToString() == "repos/owner/name/branches"), null, "application/vnd.github.luke-cage-preview+json", Args.ApiOptions); + .GetAll(Arg.Is(u => u.ToString() == "repos/owner/name/branches"), null, Args.ApiOptions); } [Fact] @@ -45,7 +45,7 @@ public async Task RequestsTheCorrectUrlWithRepositoryId() await client.GetAll(1); connection.Received() - .GetAll(Arg.Is(u => u.ToString() == "repositories/1/branches"), null, "application/vnd.github.luke-cage-preview+json", Args.ApiOptions); + .GetAll(Arg.Is(u => u.ToString() == "repositories/1/branches"), null, Args.ApiOptions); } [Fact] @@ -64,7 +64,7 @@ public async Task RequestsTheCorrectUrlWithApiOptions() await client.GetAll("owner", "name", options); connection.Received() - .GetAll(Arg.Is(u => u.ToString() == "repos/owner/name/branches"), null, "application/vnd.github.luke-cage-preview+json", options); + .GetAll(Arg.Is(u => u.ToString() == "repos/owner/name/branches"), null, options); } [Fact] @@ -83,7 +83,7 @@ public async Task RequestsTheCorrectUrlWithRepositoryIdWithApiOptions() await client.GetAll(1, options); connection.Received() - .GetAll(Arg.Is(u => u.ToString() == "repositories/1/branches"), null, "application/vnd.github.luke-cage-preview+json", options); + .GetAll(Arg.Is(u => u.ToString() == "repositories/1/branches"), null, options); } [Fact] @@ -118,7 +118,7 @@ public async Task RequestsTheCorrectUrl() await client.Get("owner", "repo", "branch"); connection.Received() - .Get(Arg.Is(u => u.ToString() == "repos/owner/repo/branches/branch"), null, "application/vnd.github.luke-cage-preview+json"); + .Get(Arg.Is(u => u.ToString() == "repos/owner/repo/branches/branch"), null); } [Fact] @@ -130,7 +130,7 @@ public async Task RequestsTheCorrectUrlWithRepositoryId() await client.Get(1, "branch"); connection.Received() - .Get(Arg.Is(u => u.ToString() == "repositories/1/branches/branch"), null, "application/vnd.github.luke-cage-preview+json"); + .Get(Arg.Is(u => u.ToString() == "repositories/1/branches/branch"), null); } [Fact] @@ -157,12 +157,11 @@ public void RequestsTheCorrectUrl() { var connection = Substitute.For(); var client = new RepositoryBranchesClient(connection); - const string previewAcceptsHeader = "application/vnd.github.luke-cage-preview+json"; client.GetBranchProtection("owner", "repo", "branch"); connection.Received() - .Get(Arg.Is(u => u.ToString() == "repos/owner/repo/branches/branch/protection"), null, previewAcceptsHeader); + .Get(Arg.Is(u => u.ToString() == "repos/owner/repo/branches/branch/protection"), null); } [Fact] @@ -170,12 +169,11 @@ public void RequestsTheCorrectUrlWithRepositoryId() { var connection = Substitute.For(); var client = new RepositoryBranchesClient(connection); - const string previewAcceptsHeader = "application/vnd.github.luke-cage-preview+json"; client.GetBranchProtection(1, "branch"); connection.Received() - .Get(Arg.Is(u => u.ToString() == "repositories/1/branches/branch/protection"), null, previewAcceptsHeader); + .Get(Arg.Is(u => u.ToString() == "repositories/1/branches/branch/protection"), null); } [Fact] @@ -206,12 +204,11 @@ public void RequestsTheCorrectUrl() var client = new RepositoryBranchesClient(connection); var update = new BranchProtectionSettingsUpdate( new BranchProtectionRequiredStatusChecksUpdate(true, new[] { "test" })); - const string previewAcceptsHeader = "application/vnd.github.luke-cage-preview+json"; client.UpdateBranchProtection("owner", "repo", "branch", update); connection.Received() - .Put(Arg.Is(u => u.ToString() == "repos/owner/repo/branches/branch/protection"), Arg.Any(), null, previewAcceptsHeader); + .Put(Arg.Is(u => u.ToString() == "repos/owner/repo/branches/branch/protection"), Arg.Any(), null); } [Fact] @@ -221,12 +218,11 @@ public void RequestsTheCorrectUrlWithRepositoryId() var client = new RepositoryBranchesClient(connection); var update = new BranchProtectionSettingsUpdate( new BranchProtectionRequiredStatusChecksUpdate(true, new[] { "test" })); - const string previewAcceptsHeader = "application/vnd.github.luke-cage-preview+json"; client.UpdateBranchProtection(1, "branch", update); connection.Received() - .Put(Arg.Is(u => u.ToString() == "repositories/1/branches/branch/protection"), Arg.Any(), null, previewAcceptsHeader); + .Put(Arg.Is(u => u.ToString() == "repositories/1/branches/branch/protection"), Arg.Any(), null); } [Fact] @@ -259,12 +255,11 @@ public void RequestsTheCorrectUrl() { var connection = Substitute.For(); var client = new RepositoryBranchesClient(connection); - const string previewAcceptsHeader = "application/vnd.github.luke-cage-preview+json"; client.DeleteBranchProtection("owner", "repo", "branch"); connection.Connection.Received() - .Delete(Arg.Is(u => u.ToString() == "repos/owner/repo/branches/branch/protection"), Arg.Any(), previewAcceptsHeader); + .Delete(Arg.Is(u => u.ToString() == "repos/owner/repo/branches/branch/protection")); } [Fact] @@ -272,12 +267,11 @@ public void RequestsTheCorrectUrlWithRepositoryId() { var connection = Substitute.For(); var client = new RepositoryBranchesClient(connection); - const string previewAcceptsHeader = "application/vnd.github.luke-cage-preview+json"; client.DeleteBranchProtection(1, "branch"); connection.Connection.Received() - .Delete(Arg.Is(u => u.ToString() == "repositories/1/branches/branch/protection"), Arg.Any(), previewAcceptsHeader); + .Delete(Arg.Is(u => u.ToString() == "repositories/1/branches/branch/protection")); } [Fact] @@ -306,12 +300,11 @@ public void RequestsTheCorrectUrl() { var connection = Substitute.For(); var client = new RepositoryBranchesClient(connection); - const string previewAcceptsHeader = "application/vnd.github.luke-cage-preview+json"; client.GetRequiredStatusChecks("owner", "repo", "branch"); connection.Received() - .Get(Arg.Is(u => u.ToString() == "repos/owner/repo/branches/branch/protection/required_status_checks"), null, previewAcceptsHeader); + .Get(Arg.Is(u => u.ToString() == "repos/owner/repo/branches/branch/protection/required_status_checks"), null); } [Fact] @@ -319,12 +312,11 @@ public void RequestsTheCorrectUrlWithRepositoryId() { var connection = Substitute.For(); var client = new RepositoryBranchesClient(connection); - const string previewAcceptsHeader = "application/vnd.github.luke-cage-preview+json"; client.GetRequiredStatusChecks(1, "branch"); connection.Received() - .Get(Arg.Is(u => u.ToString() == "repositories/1/branches/branch/protection/required_status_checks"), null, previewAcceptsHeader); + .Get(Arg.Is(u => u.ToString() == "repositories/1/branches/branch/protection/required_status_checks"), null); } [Fact] @@ -354,12 +346,11 @@ public void RequestsTheCorrectUrl() var connection = Substitute.For(); var client = new RepositoryBranchesClient(connection); var update = new BranchProtectionRequiredStatusChecksUpdate(true, new[] { "test" }); - const string previewAcceptsHeader = "application/vnd.github.luke-cage-preview+json"; client.UpdateRequiredStatusChecks("owner", "repo", "branch", update); connection.Received() - .Patch(Arg.Is(u => u.ToString() == "repos/owner/repo/branches/branch/protection/required_status_checks"), Arg.Any(), previewAcceptsHeader); + .Patch(Arg.Is(u => u.ToString() == "repos/owner/repo/branches/branch/protection/required_status_checks"), Arg.Any()); } [Fact] @@ -368,12 +359,11 @@ public void RequestsTheCorrectUrlWithRepositoryId() var connection = Substitute.For(); var client = new RepositoryBranchesClient(connection); var update = new BranchProtectionRequiredStatusChecksUpdate(true, new[] { "test" }); - const string previewAcceptsHeader = "application/vnd.github.luke-cage-preview+json"; client.UpdateRequiredStatusChecks(1, "branch", update); connection.Received() - .Patch(Arg.Is(u => u.ToString() == "repositories/1/branches/branch/protection/required_status_checks"), Arg.Any(), previewAcceptsHeader); + .Patch(Arg.Is(u => u.ToString() == "repositories/1/branches/branch/protection/required_status_checks"), Arg.Any()); } [Fact] @@ -405,12 +395,11 @@ public void RequestsTheCorrectUrl() { var connection = Substitute.For(); var client = new RepositoryBranchesClient(connection); - const string previewAcceptsHeader = "application/vnd.github.luke-cage-preview+json"; client.DeleteRequiredStatusChecks("owner", "repo", "branch"); connection.Connection.Received() - .Delete(Arg.Is(u => u.ToString() == "repos/owner/repo/branches/branch/protection/required_status_checks"), Arg.Any(), previewAcceptsHeader); + .Delete(Arg.Is(u => u.ToString() == "repos/owner/repo/branches/branch/protection/required_status_checks")); } [Fact] @@ -418,12 +407,11 @@ public void RequestsTheCorrectUrlWithRepositoryId() { var connection = Substitute.For(); var client = new RepositoryBranchesClient(connection); - const string previewAcceptsHeader = "application/vnd.github.luke-cage-preview+json"; client.DeleteRequiredStatusChecks(1, "branch"); connection.Connection.Received() - .Delete(Arg.Is(u => u.ToString() == "repositories/1/branches/branch/protection/required_status_checks"), Arg.Any(), previewAcceptsHeader); + .Delete(Arg.Is(u => u.ToString() == "repositories/1/branches/branch/protection/required_status_checks")); } [Fact] @@ -452,12 +440,11 @@ public void RequestsTheCorrectUrl() { var connection = Substitute.For(); var client = new RepositoryBranchesClient(connection); - const string previewAcceptsHeader = "application/vnd.github.luke-cage-preview+json"; client.GetAllRequiredStatusChecksContexts("owner", "repo", "branch"); connection.Received() - .Get>(Arg.Is(u => u.ToString() == "repos/owner/repo/branches/branch/protection/required_status_checks/contexts"), null, previewAcceptsHeader); + .Get>(Arg.Is(u => u.ToString() == "repos/owner/repo/branches/branch/protection/required_status_checks/contexts"), null); } [Fact] @@ -465,12 +452,11 @@ public void RequestsTheCorrectUrlWithRepositoryId() { var connection = Substitute.For(); var client = new RepositoryBranchesClient(connection); - const string previewAcceptsHeader = "application/vnd.github.luke-cage-preview+json"; client.GetAllRequiredStatusChecksContexts(1, "branch"); connection.Received() - .Get>(Arg.Is(u => u.ToString() == "repositories/1/branches/branch/protection/required_status_checks/contexts"), null, previewAcceptsHeader); + .Get>(Arg.Is(u => u.ToString() == "repositories/1/branches/branch/protection/required_status_checks/contexts"), null); } [Fact] @@ -500,12 +486,11 @@ public void RequestsTheCorrectUrl() var connection = Substitute.For(); var client = new RepositoryBranchesClient(connection); var update = new List() { "test" }; - const string previewAcceptsHeader = "application/vnd.github.luke-cage-preview+json"; client.UpdateRequiredStatusChecksContexts("owner", "repo", "branch", update); connection.Received() - .Put>(Arg.Is(u => u.ToString() == "repos/owner/repo/branches/branch/protection/required_status_checks/contexts"), Arg.Any>(), null, previewAcceptsHeader); + .Put>(Arg.Is(u => u.ToString() == "repos/owner/repo/branches/branch/protection/required_status_checks/contexts"), Arg.Any>(), null); } [Fact] @@ -514,12 +499,11 @@ public void RequestsTheCorrectUrlWithRepositoryId() var connection = Substitute.For(); var client = new RepositoryBranchesClient(connection); var update = new List() { "test" }; - const string previewAcceptsHeader = "application/vnd.github.luke-cage-preview+json"; client.UpdateRequiredStatusChecksContexts(1, "branch", update); connection.Received() - .Put>(Arg.Is(u => u.ToString() == "repositories/1/branches/branch/protection/required_status_checks/contexts"), Arg.Any>(), null, previewAcceptsHeader); + .Put>(Arg.Is(u => u.ToString() == "repositories/1/branches/branch/protection/required_status_checks/contexts"), Arg.Any>(), null); } [Fact] @@ -552,12 +536,11 @@ public void RequestsTheCorrectUrl() var connection = Substitute.For(); var client = new RepositoryBranchesClient(connection); var newContexts = new List() { "test" }; - const string previewAcceptsHeader = "application/vnd.github.luke-cage-preview+json"; client.AddRequiredStatusChecksContexts("owner", "repo", "branch", newContexts); connection.Received() - .Post>(Arg.Is(u => u.ToString() == "repos/owner/repo/branches/branch/protection/required_status_checks/contexts"), Arg.Any>(), previewAcceptsHeader); + .Post>(Arg.Is(u => u.ToString() == "repos/owner/repo/branches/branch/protection/required_status_checks/contexts"), Arg.Any>()); } [Fact] @@ -566,12 +549,11 @@ public void RequestsTheCorrectUrlWithRepositoryId() var connection = Substitute.For(); var client = new RepositoryBranchesClient(connection); var newContexts = new List() { "test" }; - const string previewAcceptsHeader = "application/vnd.github.luke-cage-preview+json"; client.AddRequiredStatusChecksContexts(1, "branch", newContexts); connection.Received() - .Post>(Arg.Is(u => u.ToString() == "repositories/1/branches/branch/protection/required_status_checks/contexts"), Arg.Any>(), previewAcceptsHeader); + .Post>(Arg.Is(u => u.ToString() == "repositories/1/branches/branch/protection/required_status_checks/contexts"), Arg.Any>()); } [Fact] @@ -604,12 +586,11 @@ public void RequestsTheCorrectUrl() var connection = Substitute.For(); var client = new RepositoryBranchesClient(connection); var contextsToRemove = new List() { "test" }; - const string previewAcceptsHeader = "application/vnd.github.luke-cage-preview+json"; client.DeleteRequiredStatusChecksContexts("owner", "repo", "branch", contextsToRemove); connection.Received() - .Delete>(Arg.Is(u => u.ToString() == "repos/owner/repo/branches/branch/protection/required_status_checks/contexts"), Arg.Any>(), previewAcceptsHeader); + .Delete>(Arg.Is(u => u.ToString() == "repos/owner/repo/branches/branch/protection/required_status_checks/contexts"), Arg.Any>()); } [Fact] @@ -618,12 +599,11 @@ public void RequestsTheCorrectUrlWithRepositoryId() var connection = Substitute.For(); var client = new RepositoryBranchesClient(connection); var contextsToRemove = new List() { "test" }; - const string previewAcceptsHeader = "application/vnd.github.luke-cage-preview+json"; client.DeleteRequiredStatusChecksContexts(1, "branch", contextsToRemove); connection.Received() - .Delete>(Arg.Is(u => u.ToString() == "repositories/1/branches/branch/protection/required_status_checks/contexts"), Arg.Any>(), previewAcceptsHeader); + .Delete>(Arg.Is(u => u.ToString() == "repositories/1/branches/branch/protection/required_status_checks/contexts"), Arg.Any>()); } [Fact] @@ -655,12 +635,11 @@ public void RequestsTheCorrectUrl() { var connection = Substitute.For(); var client = new RepositoryBranchesClient(connection); - const string previewAcceptsHeader = "application/vnd.github.luke-cage-preview+json"; client.GetReviewEnforcement("owner", "repo", "branch"); connection.Received() - .Get(Arg.Is(u => u.ToString() == "repos/owner/repo/branches/branch/protection/required_pull_request_reviews"), null, previewAcceptsHeader); + .Get(Arg.Is(u => u.ToString() == "repos/owner/repo/branches/branch/protection/required_pull_request_reviews"), null); } [Fact] @@ -668,12 +647,11 @@ public void RequestsTheCorrectUrlWithRepositoryId() { var connection = Substitute.For(); var client = new RepositoryBranchesClient(connection); - const string previewAcceptsHeader = "application/vnd.github.luke-cage-preview+json"; client.GetReviewEnforcement(1, "branch"); connection.Received() - .Get(Arg.Is(u => u.ToString() == "repositories/1/branches/branch/protection/required_pull_request_reviews"), null, previewAcceptsHeader); + .Get(Arg.Is(u => u.ToString() == "repositories/1/branches/branch/protection/required_pull_request_reviews"), null); } [Fact] @@ -703,12 +681,11 @@ public void RequestsTheCorrectUrl() var connection = Substitute.For(); var client = new RepositoryBranchesClient(connection); var update = new BranchProtectionRequiredReviewsUpdate(false, false, 2); - const string previewAcceptsHeader = "application/vnd.github.luke-cage-preview+json"; client.UpdateReviewEnforcement("owner", "repo", "branch", update); connection.Received() - .Patch(Arg.Is(u => u.ToString() == "repos/owner/repo/branches/branch/protection/required_pull_request_reviews"), Arg.Any(), previewAcceptsHeader); + .Patch(Arg.Is(u => u.ToString() == "repos/owner/repo/branches/branch/protection/required_pull_request_reviews"), Arg.Any()); } [Fact] @@ -717,12 +694,11 @@ public void RequestsTheCorrectUrlWithRepositoryId() var connection = Substitute.For(); var client = new RepositoryBranchesClient(connection); var update = new BranchProtectionRequiredReviewsUpdate(false, false, 2); - const string previewAcceptsHeader = "application/vnd.github.luke-cage-preview+json"; client.UpdateReviewEnforcement(1, "branch", update); connection.Received() - .Patch(Arg.Is(u => u.ToString() == "repositories/1/branches/branch/protection/required_pull_request_reviews"), Arg.Any(), previewAcceptsHeader); + .Patch(Arg.Is(u => u.ToString() == "repositories/1/branches/branch/protection/required_pull_request_reviews"), Arg.Any()); } [Fact] @@ -755,12 +731,11 @@ public void RequestsTheCorrectUrl() { var connection = Substitute.For(); var client = new RepositoryBranchesClient(connection); - const string previewAcceptsHeader = "application/vnd.github.luke-cage-preview+json"; client.RemoveReviewEnforcement("owner", "repo", "branch"); connection.Connection.Received() - .Delete(Arg.Is(u => u.ToString() == "repos/owner/repo/branches/branch/protection/required_pull_request_reviews"), Arg.Any(), previewAcceptsHeader); + .Delete(Arg.Is(u => u.ToString() == "repos/owner/repo/branches/branch/protection/required_pull_request_reviews")); } [Fact] @@ -768,12 +743,11 @@ public void RequestsTheCorrectUrlWithRepositoryId() { var connection = Substitute.For(); var client = new RepositoryBranchesClient(connection); - const string previewAcceptsHeader = "application/vnd.github.luke-cage-preview+json"; client.RemoveReviewEnforcement(1, "branch"); connection.Connection.Received() - .Delete(Arg.Is(u => u.ToString() == "repositories/1/branches/branch/protection/required_pull_request_reviews"), Arg.Any(), previewAcceptsHeader); + .Delete(Arg.Is(u => u.ToString() == "repositories/1/branches/branch/protection/required_pull_request_reviews")); } [Fact] @@ -802,12 +776,11 @@ public void RequestsTheCorrectUrl() { var connection = Substitute.For(); var client = new RepositoryBranchesClient(connection); - const string previewAcceptsHeader = "application/vnd.github.luke-cage-preview+json"; client.GetAdminEnforcement("owner", "repo", "branch"); connection.Received() - .Get(Arg.Is(u => u.ToString() == "repos/owner/repo/branches/branch/protection/enforce_admins"), null, previewAcceptsHeader); + .Get(Arg.Is(u => u.ToString() == "repos/owner/repo/branches/branch/protection/enforce_admins"), null); } [Fact] @@ -815,12 +788,11 @@ public void RequestsTheCorrectUrlWithRepositoryId() { var connection = Substitute.For(); var client = new RepositoryBranchesClient(connection); - const string previewAcceptsHeader = "application/vnd.github.luke-cage-preview+json"; client.GetAdminEnforcement(1, "branch"); connection.Received() - .Get(Arg.Is(u => u.ToString() == "repositories/1/branches/branch/protection/enforce_admins"), null, previewAcceptsHeader); + .Get(Arg.Is(u => u.ToString() == "repositories/1/branches/branch/protection/enforce_admins"), null); } [Fact] @@ -849,12 +821,11 @@ public void RequestsTheCorrectUrl() { var connection = Substitute.For(); var client = new RepositoryBranchesClient(connection); - const string previewAcceptsHeader = "application/vnd.github.luke-cage-preview+json"; client.AddAdminEnforcement("owner", "repo", "branch"); connection.Received() - .Post(Arg.Is(u => u.ToString() == "repos/owner/repo/branches/branch/protection/enforce_admins"), Arg.Any(), previewAcceptsHeader); + .Post(Arg.Is(u => u.ToString() == "repos/owner/repo/branches/branch/protection/enforce_admins"), Arg.Any()); } [Fact] @@ -862,12 +833,11 @@ public void RequestsTheCorrectUrlWithRepositoryId() { var connection = Substitute.For(); var client = new RepositoryBranchesClient(connection); - const string previewAcceptsHeader = "application/vnd.github.luke-cage-preview+json"; client.AddAdminEnforcement(1, "branch"); connection.Received() - .Post(Arg.Is(u => u.ToString() == "repositories/1/branches/branch/protection/enforce_admins"), Arg.Any(), previewAcceptsHeader); + .Post(Arg.Is(u => u.ToString() == "repositories/1/branches/branch/protection/enforce_admins"), Arg.Any()); } [Fact] @@ -896,12 +866,11 @@ public void RequestsTheCorrectUrl() { var connection = Substitute.For(); var client = new RepositoryBranchesClient(connection); - const string previewAcceptsHeader = "application/vnd.github.luke-cage-preview+json"; client.RemoveAdminEnforcement("owner", "repo", "branch"); connection.Connection.Received() - .Delete(Arg.Is(u => u.ToString() == "repos/owner/repo/branches/branch/protection/enforce_admins"), Arg.Any(), previewAcceptsHeader); + .Delete(Arg.Is(u => u.ToString() == "repos/owner/repo/branches/branch/protection/enforce_admins")); } [Fact] @@ -909,12 +878,11 @@ public void RequestsTheCorrectUrlWithRepositoryId() { var connection = Substitute.For(); var client = new RepositoryBranchesClient(connection); - const string previewAcceptsHeader = "application/vnd.github.luke-cage-preview+json"; client.RemoveAdminEnforcement(1, "branch"); connection.Connection.Received() - .Delete(Arg.Is(u => u.ToString() == "repositories/1/branches/branch/protection/enforce_admins"), Arg.Any(), previewAcceptsHeader); + .Delete(Arg.Is(u => u.ToString() == "repositories/1/branches/branch/protection/enforce_admins")); } [Fact] @@ -943,12 +911,11 @@ public void RequestsTheCorrectUrl() { var connection = Substitute.For(); var client = new RepositoryBranchesClient(connection); - const string previewAcceptsHeader = "application/vnd.github.luke-cage-preview+json"; client.GetProtectedBranchRestrictions("owner", "repo", "branch"); connection.Received() - .Get(Arg.Is(u => u.ToString() == "repos/owner/repo/branches/branch/protection/restrictions"), null, previewAcceptsHeader); + .Get(Arg.Is(u => u.ToString() == "repos/owner/repo/branches/branch/protection/restrictions"), null); } [Fact] @@ -956,12 +923,11 @@ public void RequestsTheCorrectUrlWithRepositoryId() { var connection = Substitute.For(); var client = new RepositoryBranchesClient(connection); - const string previewAcceptsHeader = "application/vnd.github.luke-cage-preview+json"; client.GetProtectedBranchRestrictions(1, "branch"); connection.Received() - .Get(Arg.Is(u => u.ToString() == "repositories/1/branches/branch/protection/restrictions"), null, previewAcceptsHeader); + .Get(Arg.Is(u => u.ToString() == "repositories/1/branches/branch/protection/restrictions"), null); } [Fact] @@ -990,12 +956,11 @@ public void RequestsTheCorrectUrl() { var connection = Substitute.For(); var client = new RepositoryBranchesClient(connection); - const string previewAcceptsHeader = "application/vnd.github.luke-cage-preview+json"; client.DeleteProtectedBranchRestrictions("owner", "repo", "branch"); connection.Connection.Received() - .Delete(Arg.Is(u => u.ToString() == "repos/owner/repo/branches/branch/protection/restrictions"), Arg.Any(), previewAcceptsHeader); + .Delete(Arg.Is(u => u.ToString() == "repos/owner/repo/branches/branch/protection/restrictions")); } [Fact] @@ -1003,12 +968,11 @@ public void RequestsTheCorrectUrlWithRepositoryId() { var connection = Substitute.For(); var client = new RepositoryBranchesClient(connection); - const string previewAcceptsHeader = "application/vnd.github.luke-cage-preview+json"; client.DeleteProtectedBranchRestrictions(1, "branch"); connection.Connection.Received() - .Delete(Arg.Is(u => u.ToString() == "repositories/1/branches/branch/protection/restrictions"), Arg.Any(), previewAcceptsHeader); + .Delete(Arg.Is(u => u.ToString() == "repositories/1/branches/branch/protection/restrictions")); } [Fact] @@ -1043,8 +1007,7 @@ public void RequestsTheCorrectUrl() connection.Received() .Get>( Arg.Is(u => u.ToString() == "repos/owner/repo/branches/branch/protection/restrictions/teams"), - null, - "application/vnd.github.luke-cage-preview+json"); + null); } [Fact] @@ -1058,8 +1021,7 @@ public void RequestsTheCorrectUrlWithRepositoryId() connection.Received() .Get>( Arg.Is(u => u.ToString() == "repositories/1/branches/branch/protection/restrictions/teams"), - null, - "application/vnd.github.luke-cage-preview+json"); + null); } [Fact] @@ -1096,8 +1058,7 @@ public void RequestsTheCorrectUrl() .Put>( Arg.Is(u => u.ToString() == "repos/owner/repo/branches/branch/protection/restrictions/teams"), Arg.Any>(), - null, - "application/vnd.github.luke-cage-preview+json"); + null); } [Fact] @@ -1113,8 +1074,7 @@ public void RequestsTheCorrectUrlWithRepositoryId() .Put>( Arg.Is(u => u.ToString() == "repositories/1/branches/branch/protection/restrictions/teams"), Arg.Any>(), - null, - "application/vnd.github.luke-cage-preview+json"); + null); } [Fact] @@ -1153,8 +1113,7 @@ public void RequestsTheCorrectUrl() connection.Received() .Post>( Arg.Is(u => u.ToString() == "repos/owner/repo/branches/branch/protection/restrictions/teams"), - Arg.Any>(), - "application/vnd.github.luke-cage-preview+json"); + Arg.Any>()); } [Fact] @@ -1169,8 +1128,7 @@ public void RequestsTheCorrectUrlWithRepositoryId() connection.Received() .Post>( Arg.Is(u => u.ToString() == "repositories/1/branches/branch/protection/restrictions/teams"), - Arg.Any>(), - "application/vnd.github.luke-cage-preview+json"); + Arg.Any>()); } [Fact] @@ -1209,8 +1167,7 @@ public void RequestsTheCorrectUrl() connection.Received() .Delete>( Arg.Is(u => u.ToString() == "repos/owner/repo/branches/branch/protection/restrictions/teams"), - Arg.Any(), - "application/vnd.github.luke-cage-preview+json"); + Arg.Any()); } [Fact] @@ -1225,8 +1182,7 @@ public void RequestsTheCorrectUrlWithRepositoryId() connection.Received() .Delete>( Arg.Is(u => u.ToString() == "repositories/1/branches/branch/protection/restrictions/teams"), - Arg.Any>(), - "application/vnd.github.luke-cage-preview+json"); + Arg.Any>()); } [Fact] @@ -1258,12 +1214,11 @@ public void RequestsTheCorrectUrl() { var connection = Substitute.For(); var client = new RepositoryBranchesClient(connection); - const string previewAcceptsHeader = "application/vnd.github.luke-cage-preview+json"; client.GetAllProtectedBranchUserRestrictions("owner", "repo", "branch"); connection.Received() - .Get>(Arg.Is(u => u.ToString() == "repos/owner/repo/branches/branch/protection/restrictions/users"), null, previewAcceptsHeader); + .Get>(Arg.Is(u => u.ToString() == "repos/owner/repo/branches/branch/protection/restrictions/users"), null); } [Fact] @@ -1271,12 +1226,11 @@ public void RequestsTheCorrectUrlWithRepositoryId() { var connection = Substitute.For(); var client = new RepositoryBranchesClient(connection); - const string previewAcceptsHeader = "application/vnd.github.luke-cage-preview+json"; client.GetAllProtectedBranchUserRestrictions(1, "branch"); connection.Received() - .Get>(Arg.Is(u => u.ToString() == "repositories/1/branches/branch/protection/restrictions/users"), null, previewAcceptsHeader); + .Get>(Arg.Is(u => u.ToString() == "repositories/1/branches/branch/protection/restrictions/users"), null); } [Fact] @@ -1306,12 +1260,11 @@ public void RequestsTheCorrectUrl() var connection = Substitute.For(); var client = new RepositoryBranchesClient(connection); var newUsers = new BranchProtectionUserCollection() { "test" }; - const string previewAcceptsHeader = "application/vnd.github.luke-cage-preview+json"; client.UpdateProtectedBranchUserRestrictions("owner", "repo", "branch", newUsers); connection.Received() - .Put>(Arg.Is(u => u.ToString() == "repos/owner/repo/branches/branch/protection/restrictions/users"), Arg.Any>(), null, previewAcceptsHeader); + .Put>(Arg.Is(u => u.ToString() == "repos/owner/repo/branches/branch/protection/restrictions/users"), Arg.Any>(), null); } [Fact] @@ -1320,12 +1273,11 @@ public void RequestsTheCorrectUrlWithRepositoryId() var connection = Substitute.For(); var client = new RepositoryBranchesClient(connection); var newUsers = new BranchProtectionUserCollection() { "test" }; - const string previewAcceptsHeader = "application/vnd.github.luke-cage-preview+json"; client.UpdateProtectedBranchUserRestrictions(1, "branch", newUsers); connection.Received() - .Put>(Arg.Is(u => u.ToString() == "repositories/1/branches/branch/protection/restrictions/users"), Arg.Any>(), null, previewAcceptsHeader); + .Put>(Arg.Is(u => u.ToString() == "repositories/1/branches/branch/protection/restrictions/users"), Arg.Any>(), null); } [Fact] @@ -1358,12 +1310,11 @@ public void RequestsTheCorrectUrl() var connection = Substitute.For(); var client = new RepositoryBranchesClient(connection); var newUsers = new BranchProtectionUserCollection() { "test" }; - const string previewAcceptsHeader = "application/vnd.github.luke-cage-preview+json"; client.AddProtectedBranchUserRestrictions("owner", "repo", "branch", newUsers); connection.Received() - .Post>(Arg.Is(u => u.ToString() == "repos/owner/repo/branches/branch/protection/restrictions/users"), Arg.Any>(), previewAcceptsHeader); + .Post>(Arg.Is(u => u.ToString() == "repos/owner/repo/branches/branch/protection/restrictions/users"), Arg.Any>()); } [Fact] @@ -1372,12 +1323,11 @@ public void RequestsTheCorrectUrlWithRepositoryId() var connection = Substitute.For(); var client = new RepositoryBranchesClient(connection); var newUsers = new BranchProtectionUserCollection() { "test" }; - const string previewAcceptsHeader = "application/vnd.github.luke-cage-preview+json"; client.AddProtectedBranchUserRestrictions(1, "branch", newUsers); connection.Received() - .Post>(Arg.Is(u => u.ToString() == "repositories/1/branches/branch/protection/restrictions/users"), Arg.Any>(), previewAcceptsHeader); + .Post>(Arg.Is(u => u.ToString() == "repositories/1/branches/branch/protection/restrictions/users"), Arg.Any>()); } [Fact] @@ -1410,12 +1360,11 @@ public void RequestsTheCorrectUrl() var connection = Substitute.For(); var client = new RepositoryBranchesClient(connection); var usersToRemove = new BranchProtectionUserCollection() { "test" }; - const string previewAcceptsHeader = "application/vnd.github.luke-cage-preview+json"; client.DeleteProtectedBranchUserRestrictions("owner", "repo", "branch", usersToRemove); connection.Received() - .Delete>(Arg.Is(u => u.ToString() == "repos/owner/repo/branches/branch/protection/restrictions/users"), Arg.Any>(), previewAcceptsHeader); + .Delete>(Arg.Is(u => u.ToString() == "repos/owner/repo/branches/branch/protection/restrictions/users"), Arg.Any>()); } [Fact] @@ -1424,12 +1373,11 @@ public void RequestsTheCorrectUrlWithRepositoryId() var connection = Substitute.For(); var client = new RepositoryBranchesClient(connection); var usersToRemove = new BranchProtectionUserCollection() { "test" }; - const string previewAcceptsHeader = "application/vnd.github.luke-cage-preview+json"; client.DeleteProtectedBranchUserRestrictions(1, "branch", usersToRemove); connection.Received() - .Delete>(Arg.Is(u => u.ToString() == "repositories/1/branches/branch/protection/restrictions/users"), Arg.Any>(), previewAcceptsHeader); + .Delete>(Arg.Is(u => u.ToString() == "repositories/1/branches/branch/protection/restrictions/users"), Arg.Any>()); } [Fact] diff --git a/Octokit.Tests/Clients/RepositoryCommentsClientTests.cs b/Octokit.Tests/Clients/RepositoryCommentsClientTests.cs index 40432f968f..b372c6a716 100644 --- a/Octokit.Tests/Clients/RepositoryCommentsClientTests.cs +++ b/Octokit.Tests/Clients/RepositoryCommentsClientTests.cs @@ -22,7 +22,7 @@ public async Task RequestsCorrectUrl() await client.Get("fake", "repo", 42); - connection.Received().Get(Arg.Is(u => u.ToString() == "repos/fake/repo/comments/42"), Arg.Any>(), "application/vnd.github.squirrel-girl-preview+json"); + connection.Received().Get(Arg.Is(u => u.ToString() == "repos/fake/repo/comments/42"), Arg.Any>()); } [Fact] @@ -33,7 +33,7 @@ public async Task RequestsCorrectUrlWithRepositoryId() await client.Get(1, 42); - connection.Received().Get(Arg.Is(u => u.ToString() == "repositories/1/comments/42"), Arg.Any>(), "application/vnd.github.squirrel-girl-preview+json"); + connection.Received().Get(Arg.Is(u => u.ToString() == "repositories/1/comments/42"), Arg.Any>()); } [Fact] @@ -59,7 +59,7 @@ public async Task RequestsCorrectUrl() await client.GetAllForRepository("fake", "repo"); - connection.Received().GetAll(Arg.Is(u => u.ToString() == "repos/fake/repo/comments"), Arg.Any>(), "application/vnd.github.squirrel-girl-preview+json", Args.ApiOptions); + connection.Received().GetAll(Arg.Is(u => u.ToString() == "repos/fake/repo/comments"), Arg.Any>(), Args.ApiOptions); } [Fact] @@ -70,7 +70,7 @@ public async Task RequestsCorrectUrlWithRepositoryId() await client.GetAllForRepository(1); - connection.Received().GetAll(Arg.Is(u => u.ToString() == "repositories/1/comments"), Arg.Any>(), "application/vnd.github.squirrel-girl-preview+json", Args.ApiOptions); + connection.Received().GetAll(Arg.Is(u => u.ToString() == "repositories/1/comments"), Arg.Any>(), Args.ApiOptions); } [Fact] @@ -88,7 +88,7 @@ public async Task RequestsCorrectUrlWithApiOptions() await client.GetAllForRepository("fake", "repo", options); - connection.Received().GetAll(Arg.Is(u => u.ToString() == "repos/fake/repo/comments"), Arg.Any>(), "application/vnd.github.squirrel-girl-preview+json", options); + connection.Received().GetAll(Arg.Is(u => u.ToString() == "repos/fake/repo/comments"), Arg.Any>(), options); } [Fact] @@ -106,7 +106,7 @@ public async Task RequestsCorrectUrlWithRepositoryIdWithApiOptions() await client.GetAllForRepository(1, options); - connection.Received().GetAll(Arg.Is(u => u.ToString() == "repositories/1/comments"), Arg.Any>(), "application/vnd.github.squirrel-girl-preview+json", options); + connection.Received().GetAll(Arg.Is(u => u.ToString() == "repositories/1/comments"), Arg.Any>(), options); } [Fact] @@ -143,8 +143,7 @@ public async Task RequestsCorrectUrl() connection.Received().GetAll(Arg.Is(u => u.ToString() == "repos/fake/repo/commits/sha/comments"), Arg.Any>(), - "application/vnd.github.squirrel-girl-preview+json", - Args.ApiOptions); + Args.ApiOptions); } [Fact] @@ -157,7 +156,6 @@ public async Task RequestsCorrectUrlWithRepositoryId() connection.Received().GetAll(Arg.Is(u => u.ToString() == "repositories/1/commits/sha/comments"), Arg.Any>(), - "application/vnd.github.squirrel-girl-preview+json", Args.ApiOptions); } @@ -176,8 +174,7 @@ public async Task RequestsCorrectUrlWithApiOptions() await client.GetAllForCommit("fake", "repo", "sha", options); - connection.Received().GetAll(Arg.Is(u => u.ToString() == "repos/fake/repo/commits/sha/comments"), Arg.Any>(), - "application/vnd.github.squirrel-girl-preview+json", options); + connection.Received().GetAll(Arg.Is(u => u.ToString() == "repos/fake/repo/commits/sha/comments"), Arg.Any>(), options); } [Fact] @@ -196,8 +193,7 @@ public async Task RequestsCorrectUrlWithRepositoryIdWithApiOptions() await client.GetAllForCommit(1, "sha", options); connection.Received().GetAll(Arg.Is(u => u.ToString() == "repositories/1/commits/sha/comments"), - Arg.Any>(), - "application/vnd.github.squirrel-girl-preview+json", options); + Arg.Any>(), options); } [Fact] diff --git a/Octokit.Tests/Clients/RespositoryCommitsClientTests.cs b/Octokit.Tests/Clients/RespositoryCommitsClientTests.cs index 234585c532..3e235c4e96 100644 --- a/Octokit.Tests/Clients/RespositoryCommitsClientTests.cs +++ b/Octokit.Tests/Clients/RespositoryCommitsClientTests.cs @@ -317,8 +317,7 @@ public async Task RequestsCorrectUrl() await client.GetSha1("fake", "repo", "ref"); - connection.Received().Get(Arg.Is(u => u.ToString() == "repos/fake/repo/commits/ref"), - null, "application/vnd.github.v3.sha"); + connection.Received().Get(Arg.Is(u => u.ToString() == "repos/fake/repo/commits/ref"), null); } [Fact] @@ -329,8 +328,7 @@ public async Task RequestsCorrectUrlWithRepositoryId() await client.GetSha1(1, "ref"); - connection.Received().Get(Arg.Is(u => u.ToString() == "repositories/1/commits/ref"), - null, "application/vnd.github.v3.sha"); + connection.Received().Get(Arg.Is(u => u.ToString() == "repositories/1/commits/ref"), null); } [Fact] diff --git a/Octokit.Tests/Clients/StarredClientTests.cs b/Octokit.Tests/Clients/StarredClientTests.cs index 5b07c2d04e..f8eca0df50 100644 --- a/Octokit.Tests/Clients/StarredClientTests.cs +++ b/Octokit.Tests/Clients/StarredClientTests.cs @@ -99,7 +99,7 @@ public async Task RequestsCorrectUrlWithTimestamps() await client.GetAllForCurrentWithTimestamps(); - connection.Received().GetAll(endpoint, null, "application/vnd.github.v3.star+json", Args.ApiOptions); + connection.Received().GetAll(endpoint, null, Args.ApiOptions); } [Fact] @@ -118,7 +118,7 @@ public async Task RequestsCorrectUrlWithTimestampsWithApiOptions() await client.GetAllForCurrentWithTimestamps(options); - connection.Received().GetAll(endpoint, null, "application/vnd.github.v3.star+json", options); + connection.Received().GetAll(endpoint, null, options); } [Fact] @@ -132,8 +132,7 @@ public async Task RequestsCorrectUrlWithTimestampsParametrized() await client.GetAllForCurrentWithTimestamps(request); - connection.Received().GetAll(endpoint, Arg.Is>(d => d.Count == 2 && d["direction"] == "asc"), - "application/vnd.github.v3.star+json", Args.ApiOptions); + connection.Received().GetAll(endpoint, Arg.Is>(d => d.Count == 2 && d["direction"] == "asc"), Args.ApiOptions); } [Fact] @@ -154,8 +153,7 @@ public async Task RequestsCorrectUrlWithTimestampsParametrizedWithApiOptions() await client.GetAllForCurrentWithTimestamps(request, options); - connection.Received().GetAll(endpoint, Arg.Is>(d => d.Count == 2 && d["direction"] == "asc"), - "application/vnd.github.v3.star+json", options); + connection.Received().GetAll(endpoint, Arg.Is>(d => d.Count == 2 && d["direction"] == "asc"), options); } [Fact] @@ -252,8 +250,7 @@ public async Task RequestsCorrectUrlWithTimestamps() await client.GetAllForUserWithTimestamps("banana"); - connection.Received().GetAll(endpoint, null, - "application/vnd.github.v3.star+json", Args.ApiOptions); + connection.Received().GetAll(endpoint, null, Args.ApiOptions); } [Fact] @@ -272,7 +269,7 @@ public async Task RequestsCorrectUrlWithTimestampsWithApiOptions() await client.GetAllForUserWithTimestamps("banana", options); - connection.Received().GetAll(endpoint, null, "application/vnd.github.v3.star+json", options); + connection.Received().GetAll(endpoint, null, options); } [Fact] @@ -286,8 +283,7 @@ public async Task RequestsCorrectUrlWithTimestampsParametrized() await client.GetAllForUserWithTimestamps("banana", starredRequest); - connection.Received().GetAll(endpoint, Arg.Is>(d => d.Count == 2 && d["direction"] == "asc"), - "application/vnd.github.v3.star+json", Args.ApiOptions); + connection.Received().GetAll(endpoint, Arg.Is>(d => d.Count == 2 && d["direction"] == "asc"), Args.ApiOptions); } [Fact] @@ -308,8 +304,7 @@ public async Task RequestsCorrectUrlWithTimestampsParametrizedWithApiOptions() await client.GetAllForUserWithTimestamps("banana", starredRequest, options); - connection.Received().GetAll(endpoint, Arg.Is>(d => d.Count == 2 && d["direction"] == "asc"), - "application/vnd.github.v3.star+json", options); + connection.Received().GetAll(endpoint, Arg.Is>(d => d.Count == 2 && d["direction"] == "asc"), options); } [Fact] @@ -417,7 +412,7 @@ public async Task RequestsCorrectUrlWithTimestamps() await client.GetAllStargazersWithTimestamps("fake", "repo"); - connection.Received().GetAll(endpoint, null, "application/vnd.github.v3.star+json", Args.ApiOptions); + connection.Received().GetAll(endpoint, null, Args.ApiOptions); } [Fact] @@ -429,7 +424,7 @@ public async Task RequestsCorrectUrlWithTimestampsWithRepositoryId() await client.GetAllStargazersWithTimestamps(1); - connection.Received().GetAll(endpoint, null, "application/vnd.github.v3.star+json", Args.ApiOptions); + connection.Received().GetAll(endpoint, null, Args.ApiOptions); } [Fact] @@ -448,7 +443,7 @@ public async Task RequestsCorrectUrlWithTimestampsWithApiOptions() await client.GetAllStargazersWithTimestamps("fake", "repo", options); - connection.Received().GetAll(endpoint, null, "application/vnd.github.v3.star+json", options); + connection.Received().GetAll(endpoint, null, options); } [Fact] @@ -467,7 +462,7 @@ public async Task RequestsCorrectUrlWithTimestampsWithApiOptionsWithRepositoryId await client.GetAllStargazersWithTimestamps(1, options); - connection.Received().GetAll(endpoint, null, "application/vnd.github.v3.star+json", options); + connection.Received().GetAll(endpoint, null, options); } [Fact] diff --git a/Octokit.Tests/Clients/TeamsClientTests.cs b/Octokit.Tests/Clients/TeamsClientTests.cs index ab2cad0d1a..a1b7179405 100644 --- a/Octokit.Tests/Clients/TeamsClientTests.cs +++ b/Octokit.Tests/Clients/TeamsClientTests.cs @@ -410,7 +410,6 @@ public async Task RequestsTheCorrectUrl() connection.Received().GetAll( Arg.Is(u => u.ToString() == "teams/1/invitations"), null, - "application/vnd.github.korra-preview+json", Args.ApiOptions); } } diff --git a/Octokit.Tests/Helpers/MockedIApiConnection.cs b/Octokit.Tests/Helpers/MockedIApiConnection.cs index 8d40a37f5d..640ad95dc8 100644 --- a/Octokit.Tests/Helpers/MockedIApiConnection.cs +++ b/Octokit.Tests/Helpers/MockedIApiConnection.cs @@ -9,6 +9,8 @@ public static class MockedIApiConnection public static IApiConnection PostReturnsHttpStatus(HttpStatusCode status) { var connection = Substitute.For(); + connection.Post(Arg.Any()) + .Returns(status); connection.Post(Arg.Any(), Arg.Any(), Arg.Any()) .Returns(status); diff --git a/Octokit.Tests/Reactive/Enterprise/ObservableEnterprisePreReceiveEnvironmentsClientTests.cs b/Octokit.Tests/Reactive/Enterprise/ObservableEnterprisePreReceiveEnvironmentsClientTests.cs index e6396def68..ff228f504d 100644 --- a/Octokit.Tests/Reactive/Enterprise/ObservableEnterprisePreReceiveEnvironmentsClientTests.cs +++ b/Octokit.Tests/Reactive/Enterprise/ObservableEnterprisePreReceiveEnvironmentsClientTests.cs @@ -30,7 +30,7 @@ public void RequestsTheCorrectUrl() gitHubClient.Connection.Received(1).Get>( new Uri("admin/pre-receive-environments", UriKind.Relative), Args.EmptyDictionary, - "application/vnd.github.eye-scream-preview+json"); + null); } [Fact] @@ -51,7 +51,7 @@ public void RequestsTheCorrectUrlWithApiOptions() gitHubClient.Connection.Received(1).Get>( new Uri("admin/pre-receive-environments", UriKind.Relative), Arg.Is>(d => d.Count == 2), - "application/vnd.github.eye-scream-preview+json"); + null); } [Fact] diff --git a/Octokit.Tests/Reactive/ObservableCheckRunsClientTests.cs b/Octokit.Tests/Reactive/ObservableCheckRunsClientTests.cs index 5a2036bcee..ed08646ccb 100644 --- a/Octokit.Tests/Reactive/ObservableCheckRunsClientTests.cs +++ b/Octokit.Tests/Reactive/ObservableCheckRunsClientTests.cs @@ -142,7 +142,7 @@ public async Task RequestsCorrectUrl() connection.Received().Get>( Arg.Is(u => u.ToString() == "repos/fake/repo/commits/ref/check-runs"), Args.EmptyDictionary, - "application/vnd.github.antiope-preview+json"); + null); } [Fact] @@ -157,7 +157,7 @@ public async Task RequestsCorrectUrlWithRepositoryId() connection.Received().Get>( Arg.Is(u => u.ToString() == "repositories/1/commits/ref/check-runs"), Args.EmptyDictionary, - "application/vnd.github.antiope-preview+json"); + null); } [Fact] @@ -178,7 +178,7 @@ public async Task RequestsCorrectUrlWithRequest() && x["check_name"] == "build" && x["status"] == "in_progress" && x["filter"] == "latest"), - "application/vnd.github.antiope-preview+json"); + null); } [Fact] @@ -199,7 +199,7 @@ public async Task RequestsCorrectUrlWithRequestWithRepositoryId() && x["check_name"] == "build" && x["status"] == "in_progress" && x["filter"] == "latest"), - "application/vnd.github.antiope-preview+json"); + null); } [Fact] @@ -222,7 +222,7 @@ public async Task RequestsCorrectUrlWithRequestWithApiOptions() && x["check_name"] == "build" && x["status"] == "in_progress" && x["filter"] == "latest"), - "application/vnd.github.antiope-preview+json"); + null); } [Fact] @@ -245,7 +245,7 @@ public async Task RequestsCorrectUrlWithRequestWithApiOptionsWithRepositoryId() && x["check_name"] == "build" && x["status"] == "in_progress" && x["filter"] == "latest"), - "application/vnd.github.antiope-preview+json"); + null); } [Fact] @@ -323,7 +323,7 @@ public async Task RequestsCorrectUrl() connection.Received().Get>( Arg.Is(u => u.ToString() == "repos/fake/repo/check-suites/1/check-runs"), Args.EmptyDictionary, - "application/vnd.github.antiope-preview+json"); + null); } [Fact] @@ -338,7 +338,7 @@ public async Task RequestsCorrectUrlWithRepositoryId() connection.Received().Get>( Arg.Is(u => u.ToString() == "repositories/1/check-suites/1/check-runs"), Args.EmptyDictionary, - "application/vnd.github.antiope-preview+json"); + null); } [Fact] @@ -359,7 +359,7 @@ public async Task RequestsCorrectUrlWithRequest() && x["check_name"] == "build" && x["status"] == "in_progress" && x["filter"] == "latest"), - "application/vnd.github.antiope-preview+json"); + null); } [Fact] @@ -380,7 +380,7 @@ public async Task RequestsCorrectUrlWithRequestWithRepositoryId() && x["check_name"] == "build" && x["status"] == "in_progress" && x["filter"] == "latest"), - "application/vnd.github.antiope-preview+json"); + null); } [Fact] @@ -403,7 +403,7 @@ public async Task RequestsCorrectUrlWithRequestWithApiOptions() && x["check_name"] == "build" && x["status"] == "in_progress" && x["filter"] == "latest"), - "application/vnd.github.antiope-preview+json"); + null); } [Fact] @@ -426,7 +426,7 @@ public async Task RequestsCorrectUrlWithRequestWithApiOptionsWithRepositoryId() && x["check_name"] == "build" && x["status"] == "in_progress" && x["filter"] == "latest"), - "application/vnd.github.antiope-preview+json"); + null); } [Fact] @@ -533,7 +533,7 @@ public async Task RequestsCorrectUrl() connection.Received().Get>( Arg.Is(u => u.ToString() == "repos/fake/repo/check-runs/1/annotations"), Args.EmptyDictionary, - "application/vnd.github.antiope-preview+json"); + null); } [Fact] @@ -548,7 +548,7 @@ public async Task RequestsCorrectUrlWithRepositoryId() connection.Received().Get>( Arg.Is(u => u.ToString() == "repositories/1/check-runs/1/annotations"), Args.EmptyDictionary, - "application/vnd.github.antiope-preview+json"); + null); } [Fact] @@ -567,7 +567,7 @@ public async Task RequestsCorrectUrlWithApiOptions() Arg.Is>(x => x.Count == 1 && x["per_page"] == "1"), - "application/vnd.github.antiope-preview+json"); + null); } [Fact] @@ -586,7 +586,7 @@ public async Task RequestsCorrectUrlWithApiOptionsWithRepositoryId() Arg.Is>(x => x.Count == 1 && x["per_page"] == "1"), - "application/vnd.github.antiope-preview+json"); + null); } [Fact] diff --git a/Octokit.Tests/Reactive/ObservableCheckSuitesClientTests.cs b/Octokit.Tests/Reactive/ObservableCheckSuitesClientTests.cs index 8e7024c25b..ef3e97e0b9 100644 --- a/Octokit.Tests/Reactive/ObservableCheckSuitesClientTests.cs +++ b/Octokit.Tests/Reactive/ObservableCheckSuitesClientTests.cs @@ -78,7 +78,7 @@ public async Task RequestsCorrectUrl() connection.Received().Get>( Arg.Is(u => u.ToString() == "repos/fake/repo/commits/ref/check-suites"), Args.EmptyDictionary, - "application/vnd.github.antiope-preview+json"); + null); } [Fact] @@ -93,7 +93,7 @@ public async Task RequestsCorrectUrlWithRepositoryId() connection.Received().Get>( Arg.Is(u => u.ToString() == "repositories/1/commits/ref/check-suites"), Args.EmptyDictionary, - "application/vnd.github.antiope-preview+json"); + null); } [Fact] @@ -116,7 +116,7 @@ public async Task RequestsCorrectUrlWithRequest() Arg.Is>(x => x["app_id"] == "123" && x["check_name"] == "build"), - "application/vnd.github.antiope-preview+json"); + null); } [Fact] @@ -139,7 +139,7 @@ public async Task RequestsCorrectUrlWithRequestWithRepositoryId() Arg.Is>(x => x["app_id"] == "123" && x["check_name"] == "build"), - "application/vnd.github.antiope-preview+json"); + null); } [Fact] diff --git a/Octokit.Tests/Reactive/ObservableGitHubAppInstallationsClientTests.cs b/Octokit.Tests/Reactive/ObservableGitHubAppInstallationsClientTests.cs index d665d4419e..b32239ded4 100644 --- a/Octokit.Tests/Reactive/ObservableGitHubAppInstallationsClientTests.cs +++ b/Octokit.Tests/Reactive/ObservableGitHubAppInstallationsClientTests.cs @@ -33,7 +33,7 @@ public void GetsFromCorrectUrl() connection.Received().Get>( Arg.Is(u => u.ToString() == "installation/repositories"), Args.EmptyDictionary, - "application/vnd.github.machine-man-preview+json"); + null); } [Fact] @@ -55,7 +55,7 @@ public void GetsFromCorrectUrllWithApiOptions() Arg.Is>(x => x.Count == 1 && x["per_page"] == "1"), - "application/vnd.github.machine-man-preview+json"); + null); } } @@ -73,7 +73,7 @@ public void GetsFromCorrectUrl() connection.Received().Get>( Arg.Is(u => u.ToString() == "user/installations/1234/repositories"), Args.EmptyDictionary, - "application/vnd.github.machine-man-preview+json"); + null); } [Fact] @@ -95,7 +95,7 @@ public void GetsFromCorrectUrllWithApiOptions() Arg.Is>(x => x.Count == 1 && x["per_page"] == "1"), - "application/vnd.github.machine-man-preview+json"); + null); } } } diff --git a/Octokit.Tests/Reactive/ObservableGitHubAppsClientTests.cs b/Octokit.Tests/Reactive/ObservableGitHubAppsClientTests.cs index ab74074c7b..f5633dace5 100644 --- a/Octokit.Tests/Reactive/ObservableGitHubAppsClientTests.cs +++ b/Octokit.Tests/Reactive/ObservableGitHubAppsClientTests.cs @@ -87,7 +87,7 @@ public void RequestsCorrectUrl() connection.Received().Get>( Arg.Is(u => u.ToString() == "app/installations"), Args.EmptyDictionary, - "application/vnd.github.machine-man-preview+json"); + null); } [Fact] @@ -109,7 +109,7 @@ public void RequestsTheCorrectUrlWithApiOptions() Arg.Is>(x => x.Count == 1 && x["per_page"] == "1"), - "application/vnd.github.machine-man-preview+json"); + null); } } @@ -141,7 +141,7 @@ public void GetsFromCorrectUrl() connection.Received().Get>( Arg.Is(u => u.ToString() == "user/installations"), null, - "application/vnd.github.machine-man-preview+json"); + null); } [Fact] @@ -163,7 +163,7 @@ public void GetsFromCorrectUrlWithOptions() Arg.Is>(x => x.Count == 1 && x["per_page"] == "1"), - "application/vnd.github.machine-man-preview+json"); + null); } } diff --git a/Octokit.Tests/Reactive/ObservableIssueCommentsClientTests.cs b/Octokit.Tests/Reactive/ObservableIssueCommentsClientTests.cs index d7d4b6e6f3..3c44e30ed1 100644 --- a/Octokit.Tests/Reactive/ObservableIssueCommentsClientTests.cs +++ b/Octokit.Tests/Reactive/ObservableIssueCommentsClientTests.cs @@ -59,7 +59,7 @@ public void RequestsCorrectUrl() gitHubClient.Connection.Received(1).Get>( new Uri("repos/fake/repo/issues/comments", UriKind.Relative), Arg.Any>(), - "application/vnd.github.squirrel-girl-preview+json"); + null); } [Fact] @@ -73,7 +73,7 @@ public void RequestsCorrectUrlWithRepositoryId() gitHubClient.Connection.Received(1).Get>( new Uri("repositories/1/issues/comments", UriKind.Relative), Arg.Any>(), - "application/vnd.github.squirrel-girl-preview+json"); + null); } [Fact] @@ -103,7 +103,7 @@ public void RequestsCorrectUrlWithApiOptions() && d["direction"] == "desc" && d["since"] == "2016-11-23T11:11:11Z" && d["sort"] == "updated"), - "application/vnd.github.squirrel-girl-preview+json"); + null); } [Fact] @@ -133,7 +133,7 @@ public void RequestsCorrectUrlWithRepositoryIdWithApiOptions() && d["direction"] == "desc" && d["since"] == "2016-11-23T11:11:11Z" && d["sort"] == "updated"), - "application/vnd.github.squirrel-girl-preview+json"); + null); } [Fact] @@ -172,7 +172,7 @@ public void RequestsCorrectUrl() gitHubClient.Connection.Received(1).Get>( new Uri("repos/fake/repo/issues/3/comments", UriKind.Relative), Arg.Any>(), - "application/vnd.github.squirrel-girl-preview+json"); + null); } [Fact] @@ -184,7 +184,8 @@ public void RequestsCorrectUrlWithRepositoryId() client.GetAllForIssue(1, 3); gitHubClient.Connection.Received(1).Get>( - new Uri("repositories/1/issues/3/comments", UriKind.Relative), Arg.Any>(), "application/vnd.github.squirrel-girl-preview+json"); + new Uri("repositories/1/issues/3/comments", UriKind.Relative), Arg.Any>(), + null); } [Fact] @@ -204,7 +205,7 @@ public void RequestsCorrectUrlWithIssueCommentRequest() new Uri("repos/fake/repo/issues/3/comments", UriKind.Relative), Arg.Is>(d => d.Count == 3 && d["since"] == "2016-11-23T11:11:11Z"), - "application/vnd.github.squirrel-girl-preview+json"); + null); } [Fact] @@ -224,7 +225,7 @@ public void RequestsCorrectUrlWithRepositoryIdWithIssueCommentRequest() new Uri("repositories/1/issues/3/comments", UriKind.Relative), Arg.Is>(d => d.Count == 3 && d["since"] == "2016-11-23T11:11:11Z"), - "application/vnd.github.squirrel-girl-preview+json"); + null); } [Fact] @@ -245,7 +246,7 @@ public void RequestsCorrectUrlWithApiOptions() gitHubClient.Connection.Received(1).Get>( new Uri("repos/fake/repo/issues/3/comments", UriKind.Relative), Arg.Is>(d => d.Count == 4), - "application/vnd.github.squirrel-girl-preview+json"); + null); } [Fact] @@ -266,7 +267,7 @@ public void RequestsCorrectUrlWithRepositoryIdWithApiOptions() gitHubClient.Connection.Received(1).Get>( new Uri("repositories/1/issues/3/comments", UriKind.Relative), Arg.Is>(d => d.Count == 4), - "application/vnd.github.squirrel-girl-preview+json"); + null); } [Fact] diff --git a/Octokit.Tests/Reactive/ObservableIssueTimelineClientTests.cs b/Octokit.Tests/Reactive/ObservableIssueTimelineClientTests.cs index d1cd611ba1..b7f527c2c9 100644 --- a/Octokit.Tests/Reactive/ObservableIssueTimelineClientTests.cs +++ b/Octokit.Tests/Reactive/ObservableIssueTimelineClientTests.cs @@ -38,15 +38,14 @@ public async Task RequestsCorrectUrl() IApiResponse> response = new ApiResponse>( CreateResponse(HttpStatusCode.OK), result); - gitHubClient.Connection.Get>(Args.Uri, Args.EmptyDictionary, "application/vnd.github.mockingbird-preview+json") + gitHubClient.Connection.Get>(Args.Uri, Args.EmptyDictionary, null) .Returns(Task.FromResult(response)); var timelineEvents = await client.GetAllForIssue("fake", "repo", 42).ToList(); connection.Received().Get>( Arg.Is(u => u.ToString() == "repos/fake/repo/issues/42/timeline"), - Arg.Any>(), - "application/vnd.github.mockingbird-preview+json"); + Arg.Any>(), null); Assert.Equal(1, timelineEvents.Count); } @@ -60,15 +59,14 @@ public async Task RequestsCorrectUrlWithApiOptions() var client = new ObservableIssueTimelineClient(gitHubClient); IApiResponse> response = new ApiResponse>(CreateResponse(HttpStatusCode.OK), result); - gitHubClient.Connection.Get>(Args.Uri, Arg.Is>(d => d.Count == 1), "application/vnd.github.mockingbird-preview+json") + gitHubClient.Connection.Get>(Args.Uri, Arg.Is>(d => d.Count == 1), null) .Returns(Task.FromResult(response)); var timelineEvents = await client.GetAllForIssue("fake", "repo", 42, new ApiOptions { PageSize = 30 }).ToList(); connection.Received().Get>( Arg.Is(u => u.ToString() == "repos/fake/repo/issues/42/timeline"), - Arg.Is>(d => d.Count == 1 && d["per_page"] == "30"), - "application/vnd.github.mockingbird-preview+json"); + Arg.Is>(d => d.Count == 1 && d["per_page"] == "30"), null); Assert.Equal(1, timelineEvents.Count); } @@ -81,15 +79,14 @@ public async Task RequestCorrectUrlWithRepositoryId() var client = new ObservableIssueTimelineClient(githubClient); IApiResponse> response = new ApiResponse>(CreateResponse(HttpStatusCode.OK), result); - githubClient.Connection.Get>(Args.Uri, Args.EmptyDictionary, "application/vnd.github.mockingbird-preview+json") + githubClient.Connection.Get>(Args.Uri, Args.EmptyDictionary, null) .Returns(Task.FromResult(response)); var timelineEvents = await client.GetAllForIssue(1, 42).ToList(); connection.Received().Get>( Arg.Is(u => u.ToString() == "repositories/1/issues/42/timeline"), - Arg.Any>(), - "application/vnd.github.mockingbird-preview+json"); + Arg.Any>(), null); Assert.Equal(1, timelineEvents.Count); } @@ -102,15 +99,14 @@ public async Task RequestCorrectUrlWithRepositoryIdAndApiOptions() var client = new ObservableIssueTimelineClient(githubClient); IApiResponse> response = new ApiResponse>(CreateResponse(HttpStatusCode.OK), result); - githubClient.Connection.Get>(Args.Uri, Arg.Is>(d => d.Count == 1), "application/vnd.github.mockingbird-preview+json") + githubClient.Connection.Get>(Args.Uri, Arg.Is>(d => d.Count == 1), null) .Returns(Task.FromResult(response)); var timelineEvents = await client.GetAllForIssue(1, 42, new ApiOptions { PageSize = 30 }).ToList(); connection.Received().Get>( Arg.Is(u => u.ToString() == "repositories/1/issues/42/timeline"), - Arg.Is>(d => d.Count == 1 && d["per_page"] == "30"), - "application/vnd.github.mockingbird-preview+json"); + Arg.Is>(d => d.Count == 1 && d["per_page"] == "30"), null); Assert.Equal(1, timelineEvents.Count); } diff --git a/Octokit.Tests/Reactive/ObservableIssuesClientTests.cs b/Octokit.Tests/Reactive/ObservableIssuesClientTests.cs index 10e1d6da1c..6f71dc8d4d 100644 --- a/Octokit.Tests/Reactive/ObservableIssuesClientTests.cs +++ b/Octokit.Tests/Reactive/ObservableIssuesClientTests.cs @@ -97,8 +97,7 @@ public void RequestsCorrectUrl() client.GetAllForRepository("fake", "repo"); gitHubClient.Connection.Received().Get>(Arg.Is(u => u.ToString() == "repos/fake/repo/issues"), - Arg.Any>(), - "application/vnd.github.squirrel-girl-preview+json"); + Arg.Any>(), null); } [Fact] @@ -136,7 +135,7 @@ public void RequestsCorrectUrlWithApiOptions() && d["direction"] == "desc" && d["page"] == "1" && d["per_page"] == "1"), - "application/vnd.github.squirrel-girl-preview+json"); + null); } [Fact] @@ -181,7 +180,7 @@ public void SendsAppropriateParameters() && d["state"] == "open" && d["sort"] == "created" && d["direction"] == "asc"), - "application/vnd.github.squirrel-girl-preview+json"); + null); } [Fact] @@ -229,7 +228,7 @@ public void SendsAppropriateParametersWithApiOptions() && d["direction"] == "asc" && d["page"] == "1" && d["per_page"] == "1"), - "application/vnd.github.squirrel-girl-preview+json"); + null); } [Fact] @@ -303,11 +302,12 @@ public async Task ReturnsEveryPageOfIssues() && d["direction"] == "desc" && d["state"] == "open" && d["sort"] == "created" - && d["filter"] == "assigned"), Arg.Any()) + && d["filter"] == "assigned"), + null) .Returns(Task.FromResult>>(firstPageResponse)); - gitHubClient.Connection.Get>(secondPageUrl, Arg.Any>(), "application/vnd.github.squirrel-girl-preview+json") + gitHubClient.Connection.Get>(secondPageUrl, Arg.Any>(), null) .Returns(Task.FromResult>>(secondPageResponse)); - gitHubClient.Connection.Get>(thirdPageUrl, Arg.Any>(), "application/vnd.github.squirrel-girl-preview+json") + gitHubClient.Connection.Get>(thirdPageUrl, Arg.Any>(), null) .Returns(Task.FromResult>>(lastPageResponse)); var client = new ObservableIssuesClient(gitHubClient); @@ -380,11 +380,11 @@ public async Task ReturnsEveryPageOfIssues() && d["state"] == "open" && d["sort"] == "created" && d["filter"] == "assigned"), - "application/vnd.github.squirrel-girl-preview+json") + null) .Returns(Task.FromResult>>(firstPageResponse)); - gitHubClient.Connection.Get>(secondPageUrl, Arg.Any>(), "application/vnd.github.squirrel-girl-preview+json") + gitHubClient.Connection.Get>(secondPageUrl, Arg.Any>(), null) .Returns(Task.FromResult>>(secondPageResponse)); - gitHubClient.Connection.Get>(thirdPageUrl, Arg.Any>(), "application/vnd.github.squirrel-girl-preview+json") + gitHubClient.Connection.Get>(thirdPageUrl, Arg.Any>(), null) .Returns(Task.FromResult>>(lastPageResponse)); var client = new ObservableIssuesClient(gitHubClient); @@ -466,11 +466,12 @@ public async Task ReturnsEveryPageOfIssues() && d["direction"] == "desc" && d["state"] == "open" && d["sort"] == "created" - && d["filter"] == "assigned"), "application/vnd.github.squirrel-girl-preview+json") + && d["filter"] == "assigned"), + null) .Returns(Task.FromResult>>(firstPageResponse)); - gitHubClient.Connection.Get>(secondPageUrl, Arg.Any>(), "application/vnd.github.squirrel-girl-preview+json") + gitHubClient.Connection.Get>(secondPageUrl, Arg.Any>(), null) .Returns(Task.FromResult>>(secondPageResponse)); - gitHubClient.Connection.Get>(thirdPageUrl, Arg.Any>(), "application/vnd.github.squirrel-girl-preview+json") + gitHubClient.Connection.Get>(thirdPageUrl, Arg.Any>(), null) .Returns(Task.FromResult>>(lastPageResponse)); var client = new ObservableIssuesClient(gitHubClient); @@ -534,16 +535,18 @@ public async Task ReturnsEveryPageOfIssues() } ); var gitHubClient = Substitute.For(); - gitHubClient.Connection.Get>(Arg.Is(firstPageUrl), + gitHubClient.Connection.Get>( + Arg.Is(firstPageUrl), Arg.Is>(d => d.Count == 4 && d["direction"] == "desc" && d["state"] == "open" && d["sort"] == "created" - && d["filter"] == "assigned"), "application/vnd.github.squirrel-girl-preview+json") + && d["filter"] == "assigned"), + null) .Returns(Task.FromResult>>(firstPageResponse)); - gitHubClient.Connection.Get>(secondPageUrl, Arg.Any>(), "application/vnd.github.squirrel-girl-preview+json") + gitHubClient.Connection.Get>(secondPageUrl, Arg.Any>(), null) .Returns(Task.FromResult>>(secondPageResponse)); - gitHubClient.Connection.Get>(thirdPageUrl, Arg.Any>(), "application/vnd.github.squirrel-girl-preview+json") + gitHubClient.Connection.Get>(thirdPageUrl, Arg.Any>(), null) .Returns(Task.FromResult>>(lastPageResponse)); var client = new ObservableIssuesClient(gitHubClient); diff --git a/Octokit.Tests/Reactive/ObservableOrganizationMembersClientTests.cs b/Octokit.Tests/Reactive/ObservableOrganizationMembersClientTests.cs index f64c1e8775..5d50ca20e0 100644 --- a/Octokit.Tests/Reactive/ObservableOrganizationMembersClientTests.cs +++ b/Octokit.Tests/Reactive/ObservableOrganizationMembersClientTests.cs @@ -399,8 +399,7 @@ public void RequestsTheCorrectUrl() gitHubClient.Connection.Received().GetAndFlattenAllPages( Arg.Is(u => u.ToString() == "orgs/org/invitations"), - Args.EmptyDictionary, - "application/vnd.github.korra-preview+json"); + Args.EmptyDictionary); } [Fact] @@ -419,8 +418,7 @@ public void RequestsTheCorrectUrlWithStart() gitHubClient.Connection.Received().GetAndFlattenAllPages( Arg.Is(u => u.ToString() == "orgs/org/invitations"), - Arg.Is>(d => d.Count == 2), - "application/vnd.github.korra-preview+json"); + Arg.Is>(d => d.Count == 2)); } [Fact] diff --git a/Octokit.Tests/Reactive/ObservableOrganizationOutsideCollaboratorsClientTests.cs b/Octokit.Tests/Reactive/ObservableOrganizationOutsideCollaboratorsClientTests.cs index 31a9eeca5c..bc6c8457c7 100644 --- a/Octokit.Tests/Reactive/ObservableOrganizationOutsideCollaboratorsClientTests.cs +++ b/Octokit.Tests/Reactive/ObservableOrganizationOutsideCollaboratorsClientTests.cs @@ -32,7 +32,7 @@ public void RequestsTheCorrectUrl() gitHubClient.Connection.Received(1).Get>( Arg.Is(u => u.ToString() == "orgs/org/outside_collaborators"), Args.EmptyDictionary, - "application/vnd.github.korra-preview+json"); + null); } [Fact] @@ -53,7 +53,7 @@ public void RequestsTheCorrectUrlWithApiOptions() gitHubClient.Connection.Received(1).Get>( Arg.Is(u => u.ToString() == "orgs/org/outside_collaborators"), Arg.Is>(d => d.Count == 2), - "application/vnd.github.korra-preview+json"); + null); } [Fact] @@ -88,7 +88,7 @@ public void AllFilterRequestsTheCorrectUrl() gitHubClient.Connection.Received(1).Get>( Arg.Is(u => u.ToString() == "orgs/org/outside_collaborators?filter=all"), Args.EmptyDictionary, - "application/vnd.github.korra-preview+json"); + null); } [Fact] @@ -109,7 +109,7 @@ public void AllFilterRequestsTheCorrectUrlWithApiOptions() gitHubClient.Connection.Received(1).Get>( Arg.Is(u => u.ToString() == "orgs/org/outside_collaborators?filter=all"), Arg.Is>(d => d.Count == 2), - "application/vnd.github.korra-preview+json"); + null); } [Fact] @@ -123,7 +123,7 @@ public void TwoFactorFilterRequestsTheCorrectUrl() gitHubClient.Connection.Received(1).Get>( Arg.Is(u => u.ToString() == "orgs/org/outside_collaborators?filter=2fa_disabled"), Args.EmptyDictionary, - "application/vnd.github.korra-preview+json"); + null); } [Fact] @@ -144,7 +144,7 @@ public void TwoFactorFilterRequestsTheCorrectUrlWithApiOptions() gitHubClient.Connection.Received(1).Get>( Arg.Is(u => u.ToString() == "orgs/org/outside_collaborators?filter=2fa_disabled"), Arg.Is>(d => d.Count == 2), - "application/vnd.github.korra-preview+json"); + null); } } diff --git a/Octokit.Tests/Reactive/ObservableProjectCardsClientTests.cs b/Octokit.Tests/Reactive/ObservableProjectCardsClientTests.cs index 1023bb9535..17f7c8c617 100644 --- a/Octokit.Tests/Reactive/ObservableProjectCardsClientTests.cs +++ b/Octokit.Tests/Reactive/ObservableProjectCardsClientTests.cs @@ -34,7 +34,7 @@ public void RequestCorrectURL() connection.Received().Get>( Arg.Is(u => u.ToString() == "projects/columns/1/cards"), Args.EmptyDictionary, - "application/vnd.github.inertia-preview+json"); + null); } [Fact] @@ -51,7 +51,7 @@ public async Task SendsAppropriateParameters() Arg.Is>(x => x.Count == 1 && x["archived_state"] == "not_archived"), - "application/vnd.github.inertia-preview+json"); + null); } [Fact] diff --git a/Octokit.Tests/Reactive/ObservableProjectColumnsClientTests.cs b/Octokit.Tests/Reactive/ObservableProjectColumnsClientTests.cs index 39f24b8248..0e74aa485e 100644 --- a/Octokit.Tests/Reactive/ObservableProjectColumnsClientTests.cs +++ b/Octokit.Tests/Reactive/ObservableProjectColumnsClientTests.cs @@ -34,7 +34,7 @@ public void RequestCorrectURL() connection.Received().Get>( Arg.Is(u => u.ToString() == "projects/1/columns"), Args.EmptyDictionary, - "application/vnd.github.inertia-preview+json"); + null); } [Fact] diff --git a/Octokit.Tests/Reactive/ObservableProjectsClientTests.cs b/Octokit.Tests/Reactive/ObservableProjectsClientTests.cs index d2cdad7785..2b31566113 100644 --- a/Octokit.Tests/Reactive/ObservableProjectsClientTests.cs +++ b/Octokit.Tests/Reactive/ObservableProjectsClientTests.cs @@ -35,7 +35,7 @@ public void RequestCorrectUrl() connection.Received().Get>( Arg.Is(u => u.ToString() == "repos/owner/repo/projects"), Args.EmptyDictionary, - "application/vnd.github.inertia-preview+json"); + null); } [Fact] @@ -50,7 +50,7 @@ public void RequestCorrectUrlWithRequestParameter() connection.Received().Get>( Arg.Is(u => u.ToString() == "repos/owner/repo/projects"), Arg.Is>(d => d.ContainsKey("state")), - "application/vnd.github.inertia-preview+json"); + null); } [Fact] @@ -65,7 +65,7 @@ public void RequestCorrectUrlWithRepositoryId() connection.Received().Get>( Arg.Is(u => u.ToString() == "repositories/1/projects"), Args.EmptyDictionary, - "application/vnd.github.inertia-preview+json"); + null); } [Fact] @@ -80,7 +80,7 @@ public void RequestCorrectUrlWithRequestParameterWithRepositoryId() connection.Received().Get>( Arg.Is(u => u.ToString() == "repositories/1/projects"), Arg.Is>(d => d.ContainsKey("state")), - "application/vnd.github.inertia-preview+json"); + null); } [Fact] @@ -132,7 +132,7 @@ public void RequestCorrectUrl() connection.Received().Get>( Arg.Is(u => u.ToString() == "orgs/org/projects"), Args.EmptyDictionary, - "application/vnd.github.inertia-preview+json"); + null); } [Fact] @@ -147,7 +147,7 @@ public void RequestCorrectUrlWithRequestParameter() connection.Received().Get>( Arg.Is(u => u.ToString() == "orgs/org/projects"), Arg.Is>(d => d.ContainsKey("state")), - "application/vnd.github.inertia-preview+json"); + null); } [Fact] diff --git a/Octokit.Tests/Reactive/ObservablePullRequestReviewCommentsClientTests.cs b/Octokit.Tests/Reactive/ObservablePullRequestReviewCommentsClientTests.cs index 4ae70bc8ed..a88f4ee22b 100644 --- a/Octokit.Tests/Reactive/ObservablePullRequestReviewCommentsClientTests.cs +++ b/Octokit.Tests/Reactive/ObservablePullRequestReviewCommentsClientTests.cs @@ -128,12 +128,11 @@ public async Task RequestsCorrectUrlMulti() ); var gitHubClient = Substitute.For(); - var acceptHeader = "application/vnd.github.squirrel-girl-preview+json"; - gitHubClient.Connection.Get>(firstPageUrl, Args.EmptyDictionary, acceptHeader) + gitHubClient.Connection.Get>(firstPageUrl, Args.EmptyDictionary, null) .Returns(Task.FromResult>>(firstPageResponse)); - gitHubClient.Connection.Get>(secondPageUrl, Args.EmptyDictionary, acceptHeader) + gitHubClient.Connection.Get>(secondPageUrl, Args.EmptyDictionary, null) .Returns(Task.FromResult>>(secondPageResponse)); - gitHubClient.Connection.Get>(thirdPageUrl, Args.EmptyDictionary, acceptHeader) + gitHubClient.Connection.Get>(thirdPageUrl, Args.EmptyDictionary, null) .Returns(Task.FromResult>>(lastPageResponse)); var client = new ObservablePullRequestReviewCommentsClient(gitHubClient); @@ -141,9 +140,9 @@ public async Task RequestsCorrectUrlMulti() var results = await client.GetAll("owner", "name", 7).ToArray(); Assert.Equal(7, results.Length); - gitHubClient.Connection.Received(1).Get>(firstPageUrl, Args.EmptyDictionary, acceptHeader); - gitHubClient.Connection.Received(1).Get>(secondPageUrl, Args.EmptyDictionary, acceptHeader); - gitHubClient.Connection.Received(1).Get>(thirdPageUrl, Args.EmptyDictionary, acceptHeader); + gitHubClient.Connection.Received(1).Get>(firstPageUrl, Args.EmptyDictionary, null); + gitHubClient.Connection.Received(1).Get>(secondPageUrl, Args.EmptyDictionary, null); + gitHubClient.Connection.Received(1).Get>(thirdPageUrl, Args.EmptyDictionary, null); } [Fact] @@ -347,23 +346,22 @@ public async Task RequestsCorrectUrlMulti() ); var gitHubClient = Substitute.For(); - var previewAcceptHeader = "application/vnd.github.squirrel-girl-preview+json"; gitHubClient.Connection.Get>(firstPageUrl, Arg.Is>(d => d.Count == 3 && d["direction"] == "desc" && d["since"] == "2013-11-15T11:43:01Z" - && d["sort"] == "updated"), previewAcceptHeader) + && d["sort"] == "updated"), null) .Returns(Task.FromResult>>(firstPageResponse)); gitHubClient.Connection.Get>(secondPageUrl, Arg.Is>(d => d.Count == 3 && d["direction"] == "desc" && d["since"] == "2013-11-15T11:43:01Z" - && d["sort"] == "updated"), previewAcceptHeader) + && d["sort"] == "updated"), null) .Returns(Task.FromResult>>(secondPageResponse)); gitHubClient.Connection.Get>(thirdPageUrl, Arg.Is>(d => d.Count == 3 && d["direction"] == "desc" && d["since"] == "2013-11-15T11:43:01Z" - && d["sort"] == "updated"), previewAcceptHeader) + && d["sort"] == "updated"), null) .Returns(Task.FromResult>>(lastPageResponse)); var client = new ObservablePullRequestReviewCommentsClient(gitHubClient); @@ -382,15 +380,15 @@ public async Task RequestsCorrectUrlMulti() Arg.Is>(d => d.Count == 3 && d["direction"] == "desc" && d["since"] == "2013-11-15T11:43:01Z" - && d["sort"] == "updated"), previewAcceptHeader); + && d["sort"] == "updated"), null); gitHubClient.Connection.Received(1).Get>(secondPageUrl, Arg.Is>(d => d.Count == 3 && d["direction"] == "desc" && d["since"] == "2013-11-15T11:43:01Z" - && d["sort"] == "updated"), previewAcceptHeader); + && d["sort"] == "updated"), null); gitHubClient.Connection.Received(1).Get>(thirdPageUrl, Arg.Is>(d => d.Count == 3 && d["direction"] == "desc" && d["since"] == "2013-11-15T11:43:01Z" - && d["sort"] == "updated"), previewAcceptHeader); + && d["sort"] == "updated"), null); } [Fact] @@ -436,17 +434,17 @@ public async Task RequestsCorrectUrlMultiWithRepositoryId() Arg.Is>(d => d.Count == 3 && d["direction"] == "desc" && d["since"] == "2013-11-15T11:43:01Z" - && d["sort"] == "updated"), "application/vnd.github.squirrel-girl-preview+json") + && d["sort"] == "updated"), null) .Returns(Task.FromResult>>(firstPageResponse)); gitHubClient.Connection.Get>(secondPageUrl, Arg.Is>(d => d.Count == 3 && d["direction"] == "desc" && d["since"] == "2013-11-15T11:43:01Z" - && d["sort"] == "updated"), "application/vnd.github.squirrel-girl-preview+json") + && d["sort"] == "updated"), null) .Returns(Task.FromResult>>(secondPageResponse)); gitHubClient.Connection.Get>(thirdPageUrl, Arg.Is>(d => d.Count == 3 && d["direction"] == "desc" && d["since"] == "2013-11-15T11:43:01Z" - && d["sort"] == "updated"), "application/vnd.github.squirrel-girl-preview+json") + && d["sort"] == "updated"), null) .Returns(Task.FromResult>>(lastPageResponse)); var client = new ObservablePullRequestReviewCommentsClient(gitHubClient); @@ -465,15 +463,15 @@ public async Task RequestsCorrectUrlMultiWithRepositoryId() Arg.Is>(d => d.Count == 3 && d["direction"] == "desc" && d["since"] == "2013-11-15T11:43:01Z" - && d["sort"] == "updated"), "application/vnd.github.squirrel-girl-preview+json"); + && d["sort"] == "updated"), null); gitHubClient.Connection.Received(1).Get>(secondPageUrl, Arg.Is>(d => d.Count == 3 && d["direction"] == "desc" && d["since"] == "2013-11-15T11:43:01Z" - && d["sort"] == "updated"), "application/vnd.github.squirrel-girl-preview+json"); + && d["sort"] == "updated"), null); gitHubClient.Connection.Received(1).Get>(thirdPageUrl, Arg.Is>(d => d.Count == 3 && d["direction"] == "desc" && d["since"] == "2013-11-15T11:43:01Z" - && d["sort"] == "updated"), "application/vnd.github.squirrel-girl-preview+json"); + && d["sort"] == "updated"), null); } [Fact] @@ -573,20 +571,18 @@ public async Task RequestsCorrectUrlWithoutSelectedSortingArgumentsMulti() var gitHubClient = Substitute.For(); - var previewAcceptHeader = "application/vnd.github.squirrel-girl-preview+json"; - gitHubClient.Connection.Get>(firstPageUrl, Arg.Is>(d => d.Count == 2 && d["direction"] == "asc" - && d["sort"] == "created"), previewAcceptHeader) + && d["sort"] == "created"), null) .Returns(Task.FromResult>>(firstPageResponse)); gitHubClient.Connection.Get>(secondPageUrl, Arg.Is>(d => d.Count == 2 && d["direction"] == "asc" - && d["sort"] == "created"), previewAcceptHeader) + && d["sort"] == "created"), null) .Returns(Task.FromResult>>(secondPageResponse)); gitHubClient.Connection.Get>(thirdPageUrl, Arg.Is>(d => d.Count == 2 && d["direction"] == "asc" - && d["sort"] == "created"), previewAcceptHeader) + && d["sort"] == "created"), null) .Returns(Task.FromResult>>(lastPageResponse)); var client = new ObservablePullRequestReviewCommentsClient(gitHubClient); @@ -597,13 +593,13 @@ public async Task RequestsCorrectUrlWithoutSelectedSortingArgumentsMulti() gitHubClient.Connection.Received(1).Get>(firstPageUrl, Arg.Is>(d => d.Count == 2 && d["direction"] == "asc" - && d["sort"] == "created"), previewAcceptHeader); + && d["sort"] == "created"), null); gitHubClient.Connection.Received(1).Get>(secondPageUrl, Arg.Is>(d => d.Count == 2 && d["direction"] == "asc" - && d["sort"] == "created"), previewAcceptHeader); + && d["sort"] == "created"), null); gitHubClient.Connection.Received(1).Get>(thirdPageUrl, Arg.Is>(d => d.Count == 2 && d["direction"] == "asc" - && d["sort"] == "created"), previewAcceptHeader); + && d["sort"] == "created"), null); } [Fact] @@ -648,15 +644,15 @@ public async Task RequestsCorrectUrlWithoutSelectedSortingArgumentsMultiWithRepo gitHubClient.Connection.Get>(firstPageUrl, Arg.Is>(d => d.Count == 2 && d["direction"] == "asc" - && d["sort"] == "created"), "application/vnd.github.squirrel-girl-preview+json") + && d["sort"] == "created"), null) .Returns(Task.FromResult>>(firstPageResponse)); gitHubClient.Connection.Get>(secondPageUrl, Arg.Is>(d => d.Count == 2 && d["direction"] == "asc" - && d["sort"] == "created"), "application/vnd.github.squirrel-girl-preview+json") + && d["sort"] == "created"), null) .Returns(Task.FromResult>>(secondPageResponse)); gitHubClient.Connection.Get>(thirdPageUrl, Arg.Is>(d => d.Count == 2 && d["direction"] == "asc" - && d["sort"] == "created"), "application/vnd.github.squirrel-girl-preview+json") + && d["sort"] == "created"), null) .Returns(Task.FromResult>>(lastPageResponse)); var client = new ObservablePullRequestReviewCommentsClient(gitHubClient); @@ -668,14 +664,15 @@ public async Task RequestsCorrectUrlWithoutSelectedSortingArgumentsMultiWithRepo Arg.Is>(d => d.Count == 2 && d["direction"] == "asc" && d["sort"] == "created"), - "application/vnd.github.squirrel-girl-preview+json"); + null); gitHubClient.Connection.Received(1).Get>(secondPageUrl, Arg.Is>(d => d.Count == 2 && d["direction"] == "asc" && d["sort"] == "created"), - "application/vnd.github.squirrel-girl-preview+json"); + null); gitHubClient.Connection.Received(1).Get>(thirdPageUrl, Arg.Is>(d => d.Count == 2 && d["direction"] == "asc" - && d["sort"] == "created"), "application/vnd.github.squirrel-girl-preview+json"); + && d["sort"] == "created"), + null); } [Fact] diff --git a/Octokit.Tests/Reactive/ObservablePullRequestsClientTests.cs b/Octokit.Tests/Reactive/ObservablePullRequestsClientTests.cs index d08c94a37e..dfe60b8dad 100644 --- a/Octokit.Tests/Reactive/ObservablePullRequestsClientTests.cs +++ b/Octokit.Tests/Reactive/ObservablePullRequestsClientTests.cs @@ -211,11 +211,11 @@ public async Task ReturnsEveryPageOfPullRequests() } ); var gitHubClient = Substitute.For(); - gitHubClient.Connection.Get>(firstPageUrl, Args.EmptyDictionary, "application/vnd.github.shadow-cat-preview+json") + gitHubClient.Connection.Get>(firstPageUrl, Args.EmptyDictionary, null) .Returns(Task.FromResult>>(firstPageResponse)); - gitHubClient.Connection.Get>(secondPageUrl, Args.EmptyDictionary, "application/vnd.github.shadow-cat-preview+json") + gitHubClient.Connection.Get>(secondPageUrl, Args.EmptyDictionary, null) .Returns(Task.FromResult>>(secondPageResponse)); - gitHubClient.Connection.Get>(thirdPageUrl, Args.EmptyDictionary, "application/vnd.github.shadow-cat-preview+json") + gitHubClient.Connection.Get>(thirdPageUrl, Args.EmptyDictionary, null) .Returns(Task.FromResult>>(lastPageResponse)); var client = new ObservablePullRequestsClient(gitHubClient); @@ -264,11 +264,11 @@ public async Task ReturnsEveryPageOfPullRequestsWithRepositoryId() } ); var gitHubClient = Substitute.For(); - gitHubClient.Connection.Get>(firstPageUrl, Args.EmptyDictionary, "application/vnd.github.shadow-cat-preview+json") + gitHubClient.Connection.Get>(firstPageUrl, Args.EmptyDictionary, null) .Returns(Task.FromResult>>(firstPageResponse)); - gitHubClient.Connection.Get>(secondPageUrl, Args.EmptyDictionary, "application/vnd.github.shadow-cat-preview+json") + gitHubClient.Connection.Get>(secondPageUrl, Args.EmptyDictionary, null) .Returns(Task.FromResult>>(secondPageResponse)); - gitHubClient.Connection.Get>(thirdPageUrl, Args.EmptyDictionary, "application/vnd.github.shadow-cat-preview+json") + gitHubClient.Connection.Get>(thirdPageUrl, Args.EmptyDictionary, null) .Returns(Task.FromResult>>(lastPageResponse)); var client = new ObservablePullRequestsClient(gitHubClient); @@ -323,21 +323,21 @@ public async Task SendsAppropriateParametersMulti() && d["state"] == "open" && d["base"] == "fake_base_branch" && d["sort"] == "created" - && d["direction"] == "desc"), "application/vnd.github.shadow-cat-preview+json") + && d["direction"] == "desc"), null) .Returns(Task.FromResult>>(firstPageResponse)); gitHubClient.Connection.Get>(secondPageUrl, Arg.Is>(d => d.Count == 5 && d["head"] == "user:ref-name" && d["state"] == "open" && d["base"] == "fake_base_branch" && d["sort"] == "created" - && d["direction"] == "desc"), "application/vnd.github.shadow-cat-preview+json") + && d["direction"] == "desc"), null) .Returns(Task.FromResult>>(secondPageResponse)); gitHubClient.Connection.Get>(thirdPageUrl, Arg.Is>(d => d.Count == 5 && d["head"] == "user:ref-name" && d["state"] == "open" && d["base"] == "fake_base_branch" && d["sort"] == "created" - && d["direction"] == "desc"), "application/vnd.github.shadow-cat-preview+json") + && d["direction"] == "desc"), null) .Returns(Task.FromResult>>(lastPageResponse)); var client = new ObservablePullRequestsClient(gitHubClient); @@ -392,21 +392,21 @@ public async Task SendsAppropriateParametersMultiWithRepositoryId() && d["state"] == "open" && d["base"] == "fake_base_branch" && d["sort"] == "created" - && d["direction"] == "desc"), "application/vnd.github.shadow-cat-preview+json") + && d["direction"] == "desc"), null) .Returns(Task.FromResult>>(firstPageResponse)); gitHubClient.Connection.Get>(secondPageUrl, Arg.Is>(d => d.Count == 5 && d["head"] == "user:ref-name" && d["state"] == "open" && d["base"] == "fake_base_branch" && d["sort"] == "created" - && d["direction"] == "desc"), "application/vnd.github.shadow-cat-preview+json") + && d["direction"] == "desc"), null) .Returns(Task.FromResult>>(secondPageResponse)); gitHubClient.Connection.Get>(thirdPageUrl, Arg.Is>(d => d.Count == 5 && d["head"] == "user:ref-name" && d["state"] == "open" && d["base"] == "fake_base_branch" && d["sort"] == "created" - && d["direction"] == "desc"), "application/vnd.github.shadow-cat-preview+json") + && d["direction"] == "desc"), null) .Returns(Task.FromResult>>(lastPageResponse)); var client = new ObservablePullRequestsClient(gitHubClient); diff --git a/Octokit.Tests/Reactive/ObservableRepositoryCommentsClientTests.cs b/Octokit.Tests/Reactive/ObservableRepositoryCommentsClientTests.cs index 8945a9d145..a78c59af9a 100644 --- a/Octokit.Tests/Reactive/ObservableRepositoryCommentsClientTests.cs +++ b/Octokit.Tests/Reactive/ObservableRepositoryCommentsClientTests.cs @@ -66,7 +66,7 @@ public void RequestsCorrectUrl() client.GetAllForRepository("fake", "repo"); githubClient.Connection.Received(1).Get>(Arg.Is(uri => uri.ToString() == "repos/fake/repo/comments"), - Args.EmptyDictionary, "application/vnd.github.squirrel-girl-preview+json"); + Args.EmptyDictionary, null); } [Fact] @@ -77,7 +77,7 @@ public void RequestsCorrectUrlWithRepositoryId() client.GetAllForRepository(1); githubClient.Connection.Received(1).Get>(Arg.Is(uri => uri.ToString() == "repositories/1/comments"), - Args.EmptyDictionary, "application/vnd.github.squirrel-girl-preview+json"); + Args.EmptyDictionary, null); } [Fact] @@ -95,7 +95,7 @@ public void RequestsCorrectUrlWithApiOptions() client.GetAllForRepository("fake", "repo", options); githubClient.Connection.Received(1).Get>(Arg.Is(uri => uri.ToString() == "repos/fake/repo/comments"), - Arg.Is>(dictionary => dictionary.Count == 2), "application/vnd.github.squirrel-girl-preview+json"); + Arg.Is>(dictionary => dictionary.Count == 2), null); } [Fact] @@ -113,7 +113,7 @@ public void RequestsCorrectUrlWithRepositoryIdWithApiOptions() client.GetAllForRepository(1, options); githubClient.Connection.Received(1).Get>(Arg.Is(uri => uri.ToString() == "repositories/1/comments"), - Arg.Is>(dictionary => dictionary.Count == 2), "application/vnd.github.squirrel-girl-preview+json"); + Arg.Is>(dictionary => dictionary.Count == 2), null); } [Fact] @@ -147,7 +147,7 @@ public void RequestsCorrectUrl() client.GetAllForCommit("fake", "repo", "sha"); githubClient.Connection.Received().Get>(Arg.Is(new Uri("repos/fake/repo/commits/sha/comments", UriKind.Relative)), - Args.EmptyDictionary, "application/vnd.github.squirrel-girl-preview+json"); + Args.EmptyDictionary, null); } [Fact] @@ -158,7 +158,7 @@ public void RequestsCorrectUrlWithRepositoryId() client.GetAllForCommit(1, "sha"); githubClient.Connection.Received().Get>(Arg.Is(new Uri("repositories/1/commits/sha/comments", UriKind.Relative)), - Args.EmptyDictionary, "application/vnd.github.squirrel-girl-preview+json"); + Args.EmptyDictionary, null); } [Fact] @@ -176,7 +176,7 @@ public void RequestsCorrectUrlWithApiOptions() client.GetAllForCommit("fake", "repo", "sha", options); githubClient.Connection.Received().Get>(Arg.Is(new Uri("repos/fake/repo/commits/sha/comments", UriKind.Relative)), - Arg.Is>(d => d.Count == 2), "application/vnd.github.squirrel-girl-preview+json"); + Arg.Is>(d => d.Count == 2), null); } [Fact] @@ -194,7 +194,7 @@ public void RequestsCorrectUrlWithRepositoryIdWithApiOptions() client.GetAllForCommit(1, "sha", options); githubClient.Connection.Received().Get>(Arg.Is(new Uri("repositories/1/commits/sha/comments", UriKind.Relative)), - Arg.Is>(d => d.Count == 2), "application/vnd.github.squirrel-girl-preview+json"); + Arg.Is>(d => d.Count == 2), null); } [Fact] diff --git a/Octokit.Tests/Reactive/ObservableStarredClientTests.cs b/Octokit.Tests/Reactive/ObservableStarredClientTests.cs index c650878f03..736f433c54 100644 --- a/Octokit.Tests/Reactive/ObservableStarredClientTests.cs +++ b/Octokit.Tests/Reactive/ObservableStarredClientTests.cs @@ -102,7 +102,7 @@ public void RequestsCorrectUrlWithTimestamps() client.GetAllStargazersWithTimestamps("fight", "club"); - connection.Received().Get>(endpoint, Args.EmptyDictionary, "application/vnd.github.v3.star+json"); + connection.Received().Get>(endpoint, Args.EmptyDictionary, null); } [Fact] @@ -116,7 +116,7 @@ public void RequestsCorrectUrlWithTimestampsWithRepositoryId() client.GetAllStargazersWithTimestamps(1); - connection.Received().Get>(endpoint, Args.EmptyDictionary, "application/vnd.github.v3.star+json"); + connection.Received().Get>(endpoint, Args.EmptyDictionary, null); } [Fact] @@ -137,7 +137,7 @@ public void RequestsCorrectUrlWithTimestampsWithApiOptions() client.GetAllStargazersWithTimestamps("fight", "club", options); - connection.Received().Get>(endpoint, Arg.Is>(d => d.Count == 2), "application/vnd.github.v3.star+json"); + connection.Received().Get>(endpoint, Arg.Is>(d => d.Count == 2), null); } [Fact] @@ -158,7 +158,7 @@ public void RequestsCorrectUrlWithTimestampsWithApiOptionsWithRepositoryId() client.GetAllStargazersWithTimestamps(1, options); - connection.Received().Get>(endpoint, Arg.Is>(d => d.Count == 2), "application/vnd.github.v3.star+json"); + connection.Received().Get>(endpoint, Arg.Is>(d => d.Count == 2), null); } [Fact] @@ -280,7 +280,7 @@ public void RequestsCorrectUrlWithTimestamps() client.GetAllForCurrentWithTimestamps(); - connection.Received().Get>(endpoint, Args.EmptyDictionary, "application/vnd.github.v3.star+json"); + connection.Received().Get>(endpoint, Args.EmptyDictionary, null); } [Fact] @@ -303,7 +303,7 @@ public void RequestsCorrectUrlWithTimestampsWithApiOptions() connection.Received().Get>(endpoint, Arg.Is>(d => d.Count == 2 && d["per_page"] == "1" && d["page"] == "1"), - "application/vnd.github.v3.star+json"); + null); } [Fact] @@ -320,7 +320,7 @@ public void RequestsCorrectUrlWithTimestampsParametrized() client.GetAllForCurrentWithTimestamps(request); connection.Received().Get>(endpoint, Arg.Is>(d => d.Count == 2 && d["direction"] == "asc"), - "application/vnd.github.v3.star+json"); + null); } [Fact] @@ -345,7 +345,7 @@ public void RequestsCorrectUrlWithTimestampsParametrizedWithApiOptions() connection.Received().Get>(endpoint, Arg.Is>(d => d.Count == 4 && d["direction"] == "asc" && d["per_page"] == "1" && d["page"] == "1"), - "application/vnd.github.v3.star+json"); + null); } [Fact] @@ -456,7 +456,7 @@ public void RequestsCorrectUrlWithTimestamps() client.GetAllForUserWithTimestamps("banana"); connection.Received().Get>(endpoint, Args.EmptyDictionary, - "application/vnd.github.v3.star+json"); + null); } [Fact] @@ -479,7 +479,7 @@ public void RequestsCorrectUrlWithTimestampsWithApiOptions() connection.Received().Get>(endpoint, Arg.Is>(d => d.Count == 2 && d["per_page"] == "1" && d["page"] == "1"), - "application/vnd.github.v3.star+json"); + null); } [Fact] @@ -496,7 +496,7 @@ public void RequestsCorrectUrlWithTimestampsParametrized() client.GetAllForUserWithTimestamps("banana", starredRequest); connection.Received().Get>(endpoint, Arg.Is>(d => d.Count == 2 && d["direction"] == "asc"), - "application/vnd.github.v3.star+json"); + null); } [Fact] @@ -520,7 +520,7 @@ public void RequestsCorrectUrlWithTimestampsParametrizedWithApiOptions() client.GetAllForUserWithTimestamps("banana", starredRequest, options); connection.Received().Get>(endpoint, Arg.Is>(d => d.Count == 4 && d["direction"] == "asc" && d["direction"] == "asc" && d["per_page"] == "1" && d["page"] == "1"), - "application/vnd.github.v3.star+json"); + null); } [Fact] diff --git a/Octokit.Tests/Reactive/ObservableTeamsClientTests.cs b/Octokit.Tests/Reactive/ObservableTeamsClientTests.cs index 716c931b62..66eb656276 100644 --- a/Octokit.Tests/Reactive/ObservableTeamsClientTests.cs +++ b/Octokit.Tests/Reactive/ObservableTeamsClientTests.cs @@ -208,8 +208,7 @@ public void RequestsTheCorrectUrl() gitHub.Connection.Received().GetAndFlattenAllPages( Arg.Is(u => u.ToString() == "teams/1/invitations"), - Args.EmptyDictionary, - "application/vnd.github.korra-preview+json"); + Args.EmptyDictionary); } [Fact] @@ -227,8 +226,7 @@ public void RequestsTheCorrectUrlWithApiOptions() gitHub.Connection.Received().GetAndFlattenAllPages( Arg.Is(u => u.ToString() == "teams/1/invitations"), - Arg.Is>(d => d.Count == 2), - "application/vnd.github.korra-preview+json"); + Arg.Is>(d => d.Count == 2)); } } } diff --git a/Octokit/Clients/OrganizationOutsideCollaboratorsClient.cs b/Octokit/Clients/OrganizationOutsideCollaboratorsClient.cs index 8b68009075..244981920f 100644 --- a/Octokit/Clients/OrganizationOutsideCollaboratorsClient.cs +++ b/Octokit/Clients/OrganizationOutsideCollaboratorsClient.cs @@ -119,7 +119,7 @@ public async Task Delete(string org, string user) try { - var statusCode = await Connection.Delete(ApiUrls.OutsideCollaborator(org, user), null).ConfigureAwait(false); + var statusCode = await Connection.Delete(ApiUrls.OutsideCollaborator(org, user)).ConfigureAwait(false); if (statusCode != HttpStatusCode.NoContent && statusCode != (HttpStatusCode)422) diff --git a/Octokit/Clients/RepositoryBranchesClient.cs b/Octokit/Clients/RepositoryBranchesClient.cs index 2e457a0b7e..852bc5bb34 100644 --- a/Octokit/Clients/RepositoryBranchesClient.cs +++ b/Octokit/Clients/RepositoryBranchesClient.cs @@ -215,7 +215,7 @@ public async Task DeleteBranchProtection(string owner, string name, string var endpoint = ApiUrls.RepoBranchProtection(owner, name, branch); try { - var httpStatusCode = await Connection.Delete(endpoint, null).ConfigureAwait(false); + var httpStatusCode = await Connection.Delete(endpoint).ConfigureAwait(false); return httpStatusCode == HttpStatusCode.NoContent; } catch (NotFoundException) @@ -240,7 +240,7 @@ public async Task DeleteBranchProtection(long repositoryId, string branch) var endpoint = ApiUrls.RepoBranchProtection(repositoryId, branch); try { - var httpStatusCode = await Connection.Delete(endpoint, null).ConfigureAwait(false); + var httpStatusCode = await Connection.Delete(endpoint).ConfigureAwait(false); return httpStatusCode == HttpStatusCode.NoContent; } catch (NotFoundException) @@ -343,7 +343,7 @@ public async Task DeleteRequiredStatusChecks(string owner, string name, st try { - var httpStatusCode = await Connection.Delete(endpoint, null).ConfigureAwait(false); + var httpStatusCode = await Connection.Delete(endpoint).ConfigureAwait(false); return httpStatusCode == HttpStatusCode.NoContent; } catch (NotFoundException) @@ -369,7 +369,7 @@ public async Task DeleteRequiredStatusChecks(long repositoryId, string bra try { - var httpStatusCode = await Connection.Delete(endpoint, null).ConfigureAwait(false); + var httpStatusCode = await Connection.Delete(endpoint).ConfigureAwait(false); return httpStatusCode == HttpStatusCode.NoContent; } catch (NotFoundException) @@ -624,7 +624,7 @@ public async Task RemoveReviewEnforcement(string owner, string name, strin try { - var httpStatusCode = await Connection.Delete(endpoint, null).ConfigureAwait(false); + var httpStatusCode = await Connection.Delete(endpoint).ConfigureAwait(false); return httpStatusCode == HttpStatusCode.NoContent; } catch (NotFoundException) @@ -650,7 +650,7 @@ public async Task RemoveReviewEnforcement(long repositoryId, string branch try { - var httpStatusCode = await Connection.Delete(endpoint, null).ConfigureAwait(false); + var httpStatusCode = await Connection.Delete(endpoint).ConfigureAwait(false); return httpStatusCode == HttpStatusCode.NoContent; } catch (NotFoundException) @@ -749,7 +749,7 @@ public async Task RemoveAdminEnforcement(string owner, string name, string try { - var httpStatusCode = await Connection.Delete(endpoint, null).ConfigureAwait(false); + var httpStatusCode = await Connection.Delete(endpoint).ConfigureAwait(false); return httpStatusCode == HttpStatusCode.NoContent; } catch (NotFoundException) @@ -775,7 +775,7 @@ public async Task RemoveAdminEnforcement(long repositoryId, string branch) try { - var httpStatusCode = await Connection.Delete(endpoint, null).ConfigureAwait(false); + var httpStatusCode = await Connection.Delete(endpoint).ConfigureAwait(false); return httpStatusCode == HttpStatusCode.NoContent; } catch (NotFoundException) @@ -839,7 +839,7 @@ public async Task DeleteProtectedBranchRestrictions(string owner, string n try { - var httpStatusCode = await Connection.Delete(endpoint, null).ConfigureAwait(false); + var httpStatusCode = await Connection.Delete(endpoint).ConfigureAwait(false); return httpStatusCode == HttpStatusCode.NoContent; } catch (NotFoundException) @@ -865,7 +865,7 @@ public async Task DeleteProtectedBranchRestrictions(long repositoryId, str try { - var httpStatusCode = await Connection.Delete(endpoint, null).ConfigureAwait(false); + var httpStatusCode = await Connection.Delete(endpoint).ConfigureAwait(false); return httpStatusCode == HttpStatusCode.NoContent; } catch (NotFoundException) From 345d9c061dd6a634a8474b36392fc1ae8bdd085a Mon Sep 17 00:00:00 2001 From: Chris Simpson Date: Thu, 28 Jul 2022 07:45:40 +0100 Subject: [PATCH 3/4] Adding a few overloads and tweaking to remove accept headers mostly from observable --- .../ObservableGitHubAppInstallationsClient.cs | 4 +- .../Clients/ObservableGitHubAppsClient.cs | 2 +- .../Helpers/ConnectionExtensions.cs | 6 +- Octokit.Tests/Http/ApiConnectionTests.cs | 5 +- ...rprisePreReceiveEnvironmentsClientTests.cs | 6 +- .../ObservableAssigneesClientTests.cs | 8 +- .../ObservableAuthorizationsClientTests.cs | 4 +- .../ObservableCheckRunsClientTests.cs | 48 ++++-------- .../ObservableCheckSuitesClientTests.cs | 12 +-- .../ObservableDeploymentStatusClientTests.cs | 16 +--- .../ObservableDeploymentsClientTests.cs | 24 ++---- .../Reactive/ObservableEventsClientTests.cs | 36 +++++---- .../Reactive/ObservableFollowersTest.cs | 8 +- .../Reactive/ObservableGistsTests.cs | 49 +++++------- ...rvableGitHubAppInstallationsClientTests.cs | 14 ++-- .../ObservableGitHubAppsClientTests.cs | 10 +-- .../ObservableIssueCommentsClientTests.cs | 30 +++----- .../ObservableIssueTimelineClientTests.cs | 16 ++-- .../Reactive/ObservableIssuesClientTests.cs | 48 +++++------- .../ObservableIssuesEventsClientTests.cs | 32 ++++---- .../ObservableIssuesLabelsClientTests.cs | 24 +++--- .../ObservableMilestonesClientTests.cs | 12 +-- .../ObservableNotificationsClientTests.cs | 36 +++++---- ...bservableOrganizationMembersClientTests.cs | 14 ++-- ...nizationOutsideCollaboratorsClientTests.cs | 18 ++--- .../ObservableProjectCardsClientTests.cs | 6 +- .../ObservableProjectColumnsClientTests.cs | 3 +- .../Reactive/ObservableProjectsClientTests.cs | 18 ++--- ...blePullRequestReviewCommentsClientTests.cs | 75 +++++++++---------- ...ObservablePullRequestReviewsClientTests.cs | 24 +++--- .../ObservablePullRequestsClientTests.cs | 40 +++++----- .../Reactive/ObservableReleasesClientTests.cs | 18 ++--- .../ObservableRepoCollaboratorsClientTests.cs | 42 ++++------- .../ObservableRepositoriesClientTests.cs | 69 ++++++++--------- ...ObservableRepositoryBranchesClientTests.cs | 8 +- ...ObservableRepositoryCommentsClientTests.cs | 16 ++-- ...ObservableRepositoryContentsClientTests.cs | 32 ++++---- ...servableRepositoryDeployKeysClientTests.cs | 20 ++--- .../Reactive/ObservableStarredClientTests.cs | 57 ++++++-------- .../Reactive/ObservableTeamsClientTests.cs | 12 +-- ...ObservableUserAdministrationClientTests.cs | 1 - .../ObservableUserEmailsClientTests.cs | 4 +- .../Reactive/ObservableWatchedClientTests.cs | 16 ++-- Octokit/Helpers/ApiExtensions.cs | 2 +- Octokit/Http/Connection.cs | 7 ++ Octokit/Http/IConnection.cs | 10 +++ 46 files changed, 422 insertions(+), 540 deletions(-) diff --git a/Octokit.Reactive/Clients/ObservableGitHubAppInstallationsClient.cs b/Octokit.Reactive/Clients/ObservableGitHubAppInstallationsClient.cs index 85371a9fcf..531aa23aa8 100644 --- a/Octokit.Reactive/Clients/ObservableGitHubAppInstallationsClient.cs +++ b/Octokit.Reactive/Clients/ObservableGitHubAppInstallationsClient.cs @@ -38,7 +38,7 @@ public IObservable GetAllRepositoriesForCurrent() /// https://developer.github.com/v3/apps/installations/#list-repositories public IObservable GetAllRepositoriesForCurrent(ApiOptions options) { - return _connection.GetAndFlattenAllPages(ApiUrls.InstallationRepositories(), null, options); + return _connection.GetAndFlattenAllPages(ApiUrls.InstallationRepositories(), options); } /// @@ -59,7 +59,7 @@ public IObservable GetAllRepositoriesForCurrentUser(long i /// https://developer.github.com/v3/apps/installations/#list-repositories-accessible-to-the-user-for-an-installation public IObservable GetAllRepositoriesForCurrentUser(long installationId, ApiOptions options) { - return _connection.GetAndFlattenAllPages(ApiUrls.UserInstallationRepositories(installationId), null, options); + return _connection.GetAndFlattenAllPages(ApiUrls.UserInstallationRepositories(installationId), options); } } } \ No newline at end of file diff --git a/Octokit.Reactive/Clients/ObservableGitHubAppsClient.cs b/Octokit.Reactive/Clients/ObservableGitHubAppsClient.cs index 22f3078815..c3baf089ec 100644 --- a/Octokit.Reactive/Clients/ObservableGitHubAppsClient.cs +++ b/Octokit.Reactive/Clients/ObservableGitHubAppsClient.cs @@ -111,7 +111,7 @@ public IObservable GetAllInstallationsForCurrentUser() /// https://developer.github.com/v3/apps/#list-installations-for-user public IObservable GetAllInstallationsForCurrentUser(ApiOptions options) { - return _connection.GetAndFlattenAllPages(ApiUrls.UserInstallations(), null, options); + return _connection.GetAndFlattenAllPages(ApiUrls.UserInstallations(), options); } /// diff --git a/Octokit.Reactive/Helpers/ConnectionExtensions.cs b/Octokit.Reactive/Helpers/ConnectionExtensions.cs index c60ee36666..74902050fa 100644 --- a/Octokit.Reactive/Helpers/ConnectionExtensions.cs +++ b/Octokit.Reactive/Helpers/ConnectionExtensions.cs @@ -10,7 +10,7 @@ public static class ConnectionExtensions { public static IObservable GetAndFlattenAllPages(this IConnection connection, Uri url) { - return GetPages(url, null, (pageUrl, pageParams) => connection.Get>(pageUrl, null, null).ToObservable()); + return GetPages(url, null, (pageUrl, pageParams) => connection.Get>(pageUrl, null).ToObservable()); } public static IObservable GetAndFlattenAllPages(this IConnection connection, Uri url, ApiOptions options) @@ -20,7 +20,7 @@ public static IObservable GetAndFlattenAllPages(this IConnection connectio public static IObservable GetAndFlattenAllPages(this IConnection connection, Uri url, IDictionary parameters) { - return GetPages(url, parameters, (pageUrl, pageParams) => connection.Get>(pageUrl, pageParams, null).ToObservable()); + return GetPages(url, parameters, (pageUrl, pageParams) => connection.Get>(pageUrl, pageParams).ToObservable()); } public static IObservable GetAndFlattenAllPages(this IConnection connection, Uri url, IDictionary parameters, ApiOptions options) @@ -28,7 +28,7 @@ public static IObservable GetAndFlattenAllPages(this IConnection connectio return GetPagesWithOptions(url, parameters, options, (pageUrl, pageParams, o) => { var passingParameters = Pagination.Setup(parameters, options); - return connection.Get>(pageUrl, passingParameters, null).ToObservable(); + return connection.Get>(pageUrl, passingParameters).ToObservable(); }); } diff --git a/Octokit.Tests/Http/ApiConnectionTests.cs b/Octokit.Tests/Http/ApiConnectionTests.cs index 660ee1ed19..52d981689d 100644 --- a/Octokit.Tests/Http/ApiConnectionTests.cs +++ b/Octokit.Tests/Http/ApiConnectionTests.cs @@ -22,13 +22,14 @@ public async Task MakesGetRequestForItem() var getUri = new Uri("anything", UriKind.Relative); IApiResponse response = new ApiResponse(CreateResponse(HttpStatusCode.OK)); var connection = Substitute.For(); - connection.Get(Args.Uri, null, null).Returns(Task.FromResult(response)); + connection.Get(Args.Uri, null).Returns(Task.FromResult(response)); var apiConnection = new ApiConnection(connection); var data = await apiConnection.Get(getUri); Assert.Same(response.Body, data); - connection.Received().GetResponse(getUri); + var calls = connection.ReceivedCalls(); + connection.Received().Get(getUri, null, null); } [Fact] diff --git a/Octokit.Tests/Reactive/Enterprise/ObservableEnterprisePreReceiveEnvironmentsClientTests.cs b/Octokit.Tests/Reactive/Enterprise/ObservableEnterprisePreReceiveEnvironmentsClientTests.cs index ff228f504d..d42d6922a9 100644 --- a/Octokit.Tests/Reactive/Enterprise/ObservableEnterprisePreReceiveEnvironmentsClientTests.cs +++ b/Octokit.Tests/Reactive/Enterprise/ObservableEnterprisePreReceiveEnvironmentsClientTests.cs @@ -29,8 +29,7 @@ public void RequestsTheCorrectUrl() gitHubClient.Connection.Received(1).Get>( new Uri("admin/pre-receive-environments", UriKind.Relative), - Args.EmptyDictionary, - null); + Args.EmptyDictionary); } [Fact] @@ -50,8 +49,7 @@ public void RequestsTheCorrectUrlWithApiOptions() gitHubClient.Connection.Received(1).Get>( new Uri("admin/pre-receive-environments", UriKind.Relative), - Arg.Is>(d => d.Count == 2), - null); + Arg.Is>(d => d.Count == 2)); } [Fact] diff --git a/Octokit.Tests/Reactive/ObservableAssigneesClientTests.cs b/Octokit.Tests/Reactive/ObservableAssigneesClientTests.cs index 21e11f6681..d374d9d390 100644 --- a/Octokit.Tests/Reactive/ObservableAssigneesClientTests.cs +++ b/Octokit.Tests/Reactive/ObservableAssigneesClientTests.cs @@ -37,7 +37,7 @@ public void RequestsCorrectUrl() client.GetAllForRepository(owner, name); gitHubClient.Connection.Received(1).Get>(_expectedUri, - Arg.Is>(dictionary => dictionary.Count == 0), null); + Arg.Is>(dictionary => dictionary.Count == 0)); } [Fact] @@ -49,7 +49,7 @@ public void RequestsCorrectUrlWithRepositoryId() client.GetAllForRepository(repositoryId); gitHubClient.Connection.Received(1).Get>(_expectedUriWithRepositoryId, - Arg.Is>(dictionary => dictionary.Count == 0), null); + Arg.Is>(dictionary => dictionary.Count == 0)); } [Fact] @@ -68,7 +68,7 @@ public void RequestsCorrectUrlWithApiOption() client.GetAllForRepository(owner, name, options); gitHubClient.Connection.Received(2).Get>(_expectedUri, - Arg.Is>(dictionary => dictionary.Count == 2), null); + Arg.Is>(dictionary => dictionary.Count == 2)); } [Fact] @@ -87,7 +87,7 @@ public void RequestsCorrectUrlWithRepositoryIdWithApiOption() client.GetAllForRepository(repositoryId, options); gitHubClient.Connection.Received(1).Get>(_expectedUriWithRepositoryId, - Arg.Is>(dictionary => dictionary.Count == 2), null); + Arg.Is>(dictionary => dictionary.Count == 2)); } [Fact] diff --git a/Octokit.Tests/Reactive/ObservableAuthorizationsClientTests.cs b/Octokit.Tests/Reactive/ObservableAuthorizationsClientTests.cs index 99d1b55d65..c7a14d24fc 100644 --- a/Octokit.Tests/Reactive/ObservableAuthorizationsClientTests.cs +++ b/Octokit.Tests/Reactive/ObservableAuthorizationsClientTests.cs @@ -21,7 +21,7 @@ public void RequestsCorrectUrl() authEndpoint.GetAll(); client.Connection.Received(1).Get>(Arg.Is(u => u.ToString() == "authorizations"), - Arg.Is>(dictionary => dictionary.Count == 0), null); + Arg.Is>(dictionary => dictionary.Count == 0)); } [Fact] @@ -33,7 +33,7 @@ public void RequestsCorrectUrlWithApiOption() authEndpoint.GetAll(ApiOptions.None); client.Connection.Received(1).Get>(Arg.Is(u => u.ToString() == "authorizations"), - Arg.Is>(dictionary => dictionary.Count == 0), null); + Arg.Is>(dictionary => dictionary.Count == 0)); } [Fact] diff --git a/Octokit.Tests/Reactive/ObservableCheckRunsClientTests.cs b/Octokit.Tests/Reactive/ObservableCheckRunsClientTests.cs index ed08646ccb..0936b82cd4 100644 --- a/Octokit.Tests/Reactive/ObservableCheckRunsClientTests.cs +++ b/Octokit.Tests/Reactive/ObservableCheckRunsClientTests.cs @@ -141,8 +141,7 @@ public async Task RequestsCorrectUrl() connection.Received().Get>( Arg.Is(u => u.ToString() == "repos/fake/repo/commits/ref/check-runs"), - Args.EmptyDictionary, - null); + Args.EmptyDictionary); } [Fact] @@ -156,8 +155,7 @@ public async Task RequestsCorrectUrlWithRepositoryId() connection.Received().Get>( Arg.Is(u => u.ToString() == "repositories/1/commits/ref/check-runs"), - Args.EmptyDictionary, - null); + Args.EmptyDictionary); } [Fact] @@ -177,8 +175,7 @@ public async Task RequestsCorrectUrlWithRequest() x.Count == 3 && x["check_name"] == "build" && x["status"] == "in_progress" - && x["filter"] == "latest"), - null); + && x["filter"] == "latest")); } [Fact] @@ -198,8 +195,7 @@ public async Task RequestsCorrectUrlWithRequestWithRepositoryId() x.Count == 3 && x["check_name"] == "build" && x["status"] == "in_progress" - && x["filter"] == "latest"), - null); + && x["filter"] == "latest")); } [Fact] @@ -221,8 +217,7 @@ public async Task RequestsCorrectUrlWithRequestWithApiOptions() && x["per_page"] == "1" && x["check_name"] == "build" && x["status"] == "in_progress" - && x["filter"] == "latest"), - null); + && x["filter"] == "latest")); } [Fact] @@ -244,8 +239,7 @@ public async Task RequestsCorrectUrlWithRequestWithApiOptionsWithRepositoryId() && x["per_page"] == "1" && x["check_name"] == "build" && x["status"] == "in_progress" - && x["filter"] == "latest"), - null); + && x["filter"] == "latest")); } [Fact] @@ -322,8 +316,7 @@ public async Task RequestsCorrectUrl() connection.Received().Get>( Arg.Is(u => u.ToString() == "repos/fake/repo/check-suites/1/check-runs"), - Args.EmptyDictionary, - null); + Args.EmptyDictionary); } [Fact] @@ -337,8 +330,7 @@ public async Task RequestsCorrectUrlWithRepositoryId() connection.Received().Get>( Arg.Is(u => u.ToString() == "repositories/1/check-suites/1/check-runs"), - Args.EmptyDictionary, - null); + Args.EmptyDictionary); } [Fact] @@ -358,8 +350,7 @@ public async Task RequestsCorrectUrlWithRequest() x.Count == 3 && x["check_name"] == "build" && x["status"] == "in_progress" - && x["filter"] == "latest"), - null); + && x["filter"] == "latest")); } [Fact] @@ -379,8 +370,7 @@ public async Task RequestsCorrectUrlWithRequestWithRepositoryId() x.Count == 3 && x["check_name"] == "build" && x["status"] == "in_progress" - && x["filter"] == "latest"), - null); + && x["filter"] == "latest")); } [Fact] @@ -402,8 +392,7 @@ public async Task RequestsCorrectUrlWithRequestWithApiOptions() && x["per_page"] == "1" && x["check_name"] == "build" && x["status"] == "in_progress" - && x["filter"] == "latest"), - null); + && x["filter"] == "latest")); } [Fact] @@ -425,8 +414,7 @@ public async Task RequestsCorrectUrlWithRequestWithApiOptionsWithRepositoryId() && x["per_page"] == "1" && x["check_name"] == "build" && x["status"] == "in_progress" - && x["filter"] == "latest"), - null); + && x["filter"] == "latest")); } [Fact] @@ -532,8 +520,7 @@ public async Task RequestsCorrectUrl() connection.Received().Get>( Arg.Is(u => u.ToString() == "repos/fake/repo/check-runs/1/annotations"), - Args.EmptyDictionary, - null); + Args.EmptyDictionary); } [Fact] @@ -547,8 +534,7 @@ public async Task RequestsCorrectUrlWithRepositoryId() connection.Received().Get>( Arg.Is(u => u.ToString() == "repositories/1/check-runs/1/annotations"), - Args.EmptyDictionary, - null); + Args.EmptyDictionary); } [Fact] @@ -566,8 +552,7 @@ public async Task RequestsCorrectUrlWithApiOptions() Arg.Is(u => u.ToString() == "repos/fake/repo/check-runs/1/annotations"), Arg.Is>(x => x.Count == 1 - && x["per_page"] == "1"), - null); + && x["per_page"] == "1")); } [Fact] @@ -585,8 +570,7 @@ public async Task RequestsCorrectUrlWithApiOptionsWithRepositoryId() Arg.Is(u => u.ToString() == "repositories/1/check-runs/1/annotations"), Arg.Is>(x => x.Count == 1 - && x["per_page"] == "1"), - null); + && x["per_page"] == "1")); } [Fact] diff --git a/Octokit.Tests/Reactive/ObservableCheckSuitesClientTests.cs b/Octokit.Tests/Reactive/ObservableCheckSuitesClientTests.cs index ef3e97e0b9..a6c75dc7a5 100644 --- a/Octokit.Tests/Reactive/ObservableCheckSuitesClientTests.cs +++ b/Octokit.Tests/Reactive/ObservableCheckSuitesClientTests.cs @@ -77,8 +77,7 @@ public async Task RequestsCorrectUrl() connection.Received().Get>( Arg.Is(u => u.ToString() == "repos/fake/repo/commits/ref/check-suites"), - Args.EmptyDictionary, - null); + Args.EmptyDictionary); } [Fact] @@ -92,8 +91,7 @@ public async Task RequestsCorrectUrlWithRepositoryId() connection.Received().Get>( Arg.Is(u => u.ToString() == "repositories/1/commits/ref/check-suites"), - Args.EmptyDictionary, - null); + Args.EmptyDictionary); } [Fact] @@ -115,8 +113,7 @@ public async Task RequestsCorrectUrlWithRequest() Arg.Is(u => u.ToString() == "repos/fake/repo/commits/ref/check-suites"), Arg.Is>(x => x["app_id"] == "123" - && x["check_name"] == "build"), - null); + && x["check_name"] == "build")); } [Fact] @@ -138,8 +135,7 @@ public async Task RequestsCorrectUrlWithRequestWithRepositoryId() Arg.Is(u => u.ToString() == "repositories/1/commits/ref/check-suites"), Arg.Is>(x => x["app_id"] == "123" - && x["check_name"] == "build"), - null); + && x["check_name"] == "build")); } [Fact] diff --git a/Octokit.Tests/Reactive/ObservableDeploymentStatusClientTests.cs b/Octokit.Tests/Reactive/ObservableDeploymentStatusClientTests.cs index 7a7402963d..a2c3a963e7 100644 --- a/Octokit.Tests/Reactive/ObservableDeploymentStatusClientTests.cs +++ b/Octokit.Tests/Reactive/ObservableDeploymentStatusClientTests.cs @@ -30,9 +30,7 @@ public void RequestsCorrectUrl() _client.GetAll("owner", "repo", 1); _githubClient.Connection.Received(1) - .Get>(Arg.Is(uri => uri.ToString() == expectedUri), - Args.EmptyDictionary, - null); + .Get>(Arg.Is(uri => uri.ToString() == expectedUri), Args.EmptyDictionary); } [Fact] @@ -43,9 +41,7 @@ public void RequestsCorrectUrlWithRepositoryId() _client.GetAll(1, 1); _githubClient.Connection.Received(1) - .Get>(Arg.Is(uri => uri.ToString() == expectedUri), - Args.EmptyDictionary, - null); + .Get>(Arg.Is(uri => uri.ToString() == expectedUri), Args.EmptyDictionary); } [Fact] @@ -63,9 +59,7 @@ public void RequestsCorrectUrlWithApiOptions() _client.GetAll("owner", "repo", 1, options); _githubClient.Connection.Received(1) - .Get>(Arg.Is(uri => uri.ToString() == expectedUri), - Arg.Is>(dictionary => dictionary.Count == 2), - null); + .Get>(Arg.Is(uri => uri.ToString() == expectedUri), Arg.Is>(dictionary => dictionary.Count == 2)); } [Fact] @@ -83,9 +77,7 @@ public void RequestsCorrectUrlWithRepositoryIdWithApiOptions() _client.GetAll(1, 1, options); _githubClient.Connection.Received(1) - .Get>(Arg.Is(uri => uri.ToString() == expectedUri), - Arg.Is>(dictionary => dictionary.Count == 2), - null); + .Get>(Arg.Is(uri => uri.ToString() == expectedUri), Arg.Is>(dictionary => dictionary.Count == 2)); } [Fact] diff --git a/Octokit.Tests/Reactive/ObservableDeploymentsClientTests.cs b/Octokit.Tests/Reactive/ObservableDeploymentsClientTests.cs index 58bdc62d78..f2c3054e3f 100644 --- a/Octokit.Tests/Reactive/ObservableDeploymentsClientTests.cs +++ b/Octokit.Tests/Reactive/ObservableDeploymentsClientTests.cs @@ -60,8 +60,7 @@ public void RequestsCorrectUrl() _githubClient.Connection.Received(1) .Get>(Arg.Is(u => u.ToString() == expectedUrl), - Arg.Is>(dictionary => dictionary.Count == 0), - Arg.Any()); + Arg.Is>(dictionary => dictionary.Count == 0)); } [Fact] @@ -73,8 +72,7 @@ public void RequestsCorrectUrlWithRepositoryId() _githubClient.Connection.Received(1) .Get>(Arg.Is(u => u.ToString() == expectedUrl), - Arg.Is>(dictionary => dictionary.Count == 0), - Arg.Any()); + Arg.Is>(dictionary => dictionary.Count == 0)); } [Fact] @@ -93,8 +91,7 @@ public void RequestsCorrectUrlWithApiOptions() _client.GetAll(owner, name, options); _githubClient.Connection.Received(1) .Get>(Arg.Is(u => u.ToString() == expectedUrl), - Arg.Is>(dictionary => dictionary.Count == 2), - null); + Arg.Is>(dictionary => dictionary.Count == 2)); // StartPage is setted => only 1 option (StartPage) in dictionary options = new ApiOptions @@ -105,8 +102,7 @@ public void RequestsCorrectUrlWithApiOptions() _client.GetAll(owner, name, options); _githubClient.Connection.Received(1) .Get>(Arg.Is(u => u.ToString() == expectedUrl), - Arg.Is>(dictionary => dictionary.Count == 1), - null); + Arg.Is>(dictionary => dictionary.Count == 1)); // PageCount is setted => none of options in dictionary options = new ApiOptions @@ -117,8 +113,7 @@ public void RequestsCorrectUrlWithApiOptions() _client.GetAll(owner, name, options); _githubClient.Connection.Received(1) .Get>(Arg.Is(u => u.ToString() == expectedUrl), - Arg.Is>(dictionary => dictionary.Count == 0), - null); + Arg.Is>(dictionary => dictionary.Count == 0)); } [Fact] @@ -138,8 +133,7 @@ public void RequestsCorrectUrlWithRepositoryIdWithApiOptions() _githubClient.Connection.Received(1) .Get>(Arg.Is(u => u.ToString() == expectedUrl), - Arg.Is>(dictionary => dictionary.Count == 2), - null); + Arg.Is>(dictionary => dictionary.Count == 2)); // StartPage is setted => only 1 option (StartPage) in dictionary options = new ApiOptions @@ -151,8 +145,7 @@ public void RequestsCorrectUrlWithRepositoryIdWithApiOptions() _githubClient.Connection.Received(1) .Get>(Arg.Is(u => u.ToString() == expectedUrl), - Arg.Is>(dictionary => dictionary.Count == 1), - null); + Arg.Is>(dictionary => dictionary.Count == 1)); // PageCount is setted => none of options in dictionary options = new ApiOptions @@ -164,8 +157,7 @@ public void RequestsCorrectUrlWithRepositoryIdWithApiOptions() _githubClient.Connection.Received(1) .Get>(Arg.Is(u => u.ToString() == expectedUrl), - Arg.Is>(dictionary => dictionary.Count == 0), - null); + Arg.Is>(dictionary => dictionary.Count == 0)); } } diff --git a/Octokit.Tests/Reactive/ObservableEventsClientTests.cs b/Octokit.Tests/Reactive/ObservableEventsClientTests.cs index 30e9629664..245a04ab21 100644 --- a/Octokit.Tests/Reactive/ObservableEventsClientTests.cs +++ b/Octokit.Tests/Reactive/ObservableEventsClientTests.cs @@ -30,7 +30,7 @@ public void RequestsCorrectUrl() client.GetAll(); - gitHubClient.Connection.Received(1).Get>(new Uri("events", UriKind.Relative), Args.EmptyDictionary, null); + gitHubClient.Connection.Received(1).Get>(new Uri("events", UriKind.Relative), Args.EmptyDictionary); } [Fact] @@ -48,7 +48,7 @@ public void RequestsCorrectUrlWithApiOptions() client.GetAll(options); - gitHubClient.Connection.Received().Get>(new Uri("events", UriKind.Relative), Arg.Is>(d => d.Count == 2), null); + gitHubClient.Connection.Received().Get>(new Uri("events", UriKind.Relative), Arg.Is>(d => d.Count == 2)); } [Fact] @@ -71,8 +71,7 @@ public void RequestsCorrectUrl() client.GetAllForRepository("fake", "repo"); - gitHubClient.Connection.Received(1).Get>(new Uri("repos/fake/repo/events", UriKind.Relative), - Args.EmptyDictionary, null); + gitHubClient.Connection.Received(1).Get>(new Uri("repos/fake/repo/events", UriKind.Relative), Args.EmptyDictionary); } [Fact] @@ -83,8 +82,7 @@ public void RequestsCorrectUrlWithRepositoryId() client.GetAllForRepository(1); - gitHubClient.Connection.Received(1).Get>(new Uri("repositories/1/events", UriKind.Relative), - Args.EmptyDictionary, null); + gitHubClient.Connection.Received(1).Get>(new Uri("repositories/1/events", UriKind.Relative), Args.EmptyDictionary); } [Fact] @@ -103,7 +101,7 @@ public void RequestsCorrectUrlWithApiOptions() client.GetAllForRepository("fake", "repo", options); gitHubClient.Connection.Received(1).Get>(new Uri("repos/fake/repo/events", UriKind.Relative), - Arg.Is>(d => d.Count == 2), null); + Arg.Is>(d => d.Count == 2)); } [Fact] @@ -122,7 +120,7 @@ public void RequestsCorrectUrlWithRepositoryIdWithApiOptions() client.GetAllForRepository(1, apiOptions); gitHubClient.Connection.Received(1).Get>(new Uri("repositories/1/events", UriKind.Relative), - Arg.Is>(d => d.Count == 2), null); + Arg.Is>(d => d.Count == 2)); } [Fact] @@ -157,7 +155,7 @@ public void RequestsCorrectUrl() client.GetAllIssuesForRepository("fake", "repo"); gitHubClient.Connection.Received(1).Get>(new Uri("repos/fake/repo/issues/events", UriKind.Relative), - Args.EmptyDictionary, null); + Args.EmptyDictionary); } [Fact] @@ -169,7 +167,7 @@ public void RequestsCorrectUrlWithRepositoryId() client.GetAllIssuesForRepository(1); gitHubClient.Connection.Received(1).Get>(new Uri("repositories/1/issues/events", UriKind.Relative), - Args.EmptyDictionary, null); + Args.EmptyDictionary); } [Fact] @@ -188,7 +186,7 @@ public void RequestsCorrectUrlWithApiOptions() client.GetAllIssuesForRepository("fake", "repo", options); gitHubClient.Connection.Received(1).Get>(new Uri("repos/fake/repo/issues/events", UriKind.Relative), - Arg.Is>(d => d.Count == 2), null); + Arg.Is>(d => d.Count == 2)); } [Fact] @@ -207,7 +205,7 @@ public void RequestsCorrectUrlWithRepositoryIdWithApiOptions() client.GetAllIssuesForRepository(1, options); gitHubClient.Connection.Received(1).Get>(new Uri("repositories/1/issues/events", UriKind.Relative), - Arg.Is>(d => d.Count == 2), null); + Arg.Is>(d => d.Count == 2)); } [Fact] @@ -241,7 +239,7 @@ public void RequestsCorrectUrl() client.GetAllForRepositoryNetwork("fake", "repo"); - gitHubClient.Connection.Received(1).Get>(new Uri("networks/fake/repo/events", UriKind.Relative), Args.EmptyDictionary, null); + gitHubClient.Connection.Received(1).Get>(new Uri("networks/fake/repo/events", UriKind.Relative), Args.EmptyDictionary); } [Fact] @@ -267,7 +265,7 @@ public void RequestsCorrectUrl() client.GetAllForOrganization("fake"); - gitHubClient.Connection.Received(1).Get>(new Uri("orgs/fake/events", UriKind.Relative), Args.EmptyDictionary, null); + gitHubClient.Connection.Received(1).Get>(new Uri("orgs/fake/events", UriKind.Relative), Args.EmptyDictionary); } [Fact] @@ -291,7 +289,7 @@ public void RequestsCorrectUrl() client.GetAllUserReceived("fake"); - gitHubClient.Connection.Received(1).Get>(new Uri("users/fake/received_events", UriKind.Relative), Args.EmptyDictionary, null); + gitHubClient.Connection.Received(1).Get>(new Uri("users/fake/received_events", UriKind.Relative), Args.EmptyDictionary); } [Fact] @@ -315,7 +313,7 @@ public void RequestsCorrectUrl() client.GetAllUserReceivedPublic("fake"); - gitHubClient.Connection.Received(1).Get>(new Uri("users/fake/received_events/public", UriKind.Relative), Args.EmptyDictionary, null); + gitHubClient.Connection.Received(1).Get>(new Uri("users/fake/received_events/public", UriKind.Relative), Args.EmptyDictionary); } [Fact] @@ -339,7 +337,7 @@ public void RequestsCorrectUrl() client.GetAllUserPerformed("fake"); - gitHubClient.Connection.Received(1).Get>(new Uri("users/fake/events", UriKind.Relative), Args.EmptyDictionary, null); + gitHubClient.Connection.Received(1).Get>(new Uri("users/fake/events", UriKind.Relative), Args.EmptyDictionary); } [Fact] @@ -363,7 +361,7 @@ public void RequestsCorrectUrl() client.GetAllUserPerformedPublic("fake"); - gitHubClient.Connection.Received(1).Get>(new Uri("users/fake/events/public", UriKind.Relative), Args.EmptyDictionary, null); + gitHubClient.Connection.Received(1).Get>(new Uri("users/fake/events/public", UriKind.Relative), Args.EmptyDictionary); } [Fact] @@ -387,7 +385,7 @@ public void RequestsCorrectUrl() client.GetAllForAnOrganization("fake", "org"); - gitHubClient.Connection.Received(1).Get>(new Uri("users/fake/events/orgs/org", UriKind.Relative), Args.EmptyDictionary, null); + gitHubClient.Connection.Received(1).Get>(new Uri("users/fake/events/orgs/org", UriKind.Relative), Args.EmptyDictionary); } [Fact] diff --git a/Octokit.Tests/Reactive/ObservableFollowersTest.cs b/Octokit.Tests/Reactive/ObservableFollowersTest.cs index b44807e688..bf769196c2 100644 --- a/Octokit.Tests/Reactive/ObservableFollowersTest.cs +++ b/Octokit.Tests/Reactive/ObservableFollowersTest.cs @@ -25,7 +25,7 @@ public void RequestsTheCorrectUrl() client.GetAllForCurrent(); githubClient.Connection.Received(1).Get>( - new Uri("user/followers", UriKind.Relative), Args.EmptyDictionary, null); + new Uri("user/followers", UriKind.Relative), Args.EmptyDictionary); } } @@ -40,7 +40,7 @@ public void RequestsTheCorrectUrl() client.GetAll("alfhenrik"); githubClient.Connection.Received(1).Get>( - new Uri("users/alfhenrik/followers", UriKind.Relative), Args.EmptyDictionary, null); + new Uri("users/alfhenrik/followers", UriKind.Relative), Args.EmptyDictionary); } [Fact] @@ -64,7 +64,7 @@ public void RequestsTheCorrectUrl() client.GetAllFollowingForCurrent(); githubClient.Connection.Received(1).Get>( - new Uri("user/following", UriKind.Relative), Args.EmptyDictionary, null); + new Uri("user/following", UriKind.Relative), Args.EmptyDictionary); } } @@ -79,7 +79,7 @@ public void RequestsTheCorrectUrl() client.GetAllFollowing("alfhenrik"); githubClient.Connection.Received(1).Get>( - new Uri("users/alfhenrik/following", UriKind.Relative), Args.EmptyDictionary, null); + new Uri("users/alfhenrik/following", UriKind.Relative), Args.EmptyDictionary); } [Fact] diff --git a/Octokit.Tests/Reactive/ObservableGistsTests.cs b/Octokit.Tests/Reactive/ObservableGistsTests.cs index 5d69a5e27d..048cd5c691 100644 --- a/Octokit.Tests/Reactive/ObservableGistsTests.cs +++ b/Octokit.Tests/Reactive/ObservableGistsTests.cs @@ -41,7 +41,7 @@ public void RequestsTheCorrectUrl() client.GetAll(); - gitHubClient.Connection.Received(1).Get>(Arg.Is(u => u.ToString() == "gists"), Args.EmptyDictionary, null); + gitHubClient.Connection.Received(1).Get>(Arg.Is(u => u.ToString() == "gists"), Args.EmptyDictionary); } [Fact] @@ -59,7 +59,7 @@ public void RequestsTheCorrectUrlWithApiOptions() client.GetAll(options); gitHubClient.Connection.Received(1).Get>(Arg.Is(u => u.ToString() == "gists"), - DictionaryWithApiOptions, null); + DictionaryWithApiOptions); } [Fact] @@ -71,7 +71,7 @@ public void RequestsTheCorrectUrlWithSince() var since = DateTimeOffset.Now; client.GetAll(since); - gitHubClient.Connection.Received(1).Get>(Arg.Is(u => u.ToString() == "gists"), DictionaryWithSince, null); + gitHubClient.Connection.Received(1).Get>(Arg.Is(u => u.ToString() == "gists"), DictionaryWithSince); } [Fact] @@ -89,8 +89,7 @@ public void RequestsTheCorrectUrlWithSinceAndApiOptions() var since = DateTimeOffset.Now; client.GetAll(since, options); - gitHubClient.Connection.Received(1).Get>(Arg.Is(u => u.ToString() == "gists"), - DictionaryWithApiOptionsAndSince, null); + gitHubClient.Connection.Received(1).Get>(Arg.Is(u => u.ToString() == "gists"), DictionaryWithApiOptionsAndSince); } [Fact] @@ -113,7 +112,7 @@ public void RequestsTheCorrectUrl() client.GetAllPublic(); - gitHubClient.Connection.Received(1).Get>(Arg.Is(u => u.ToString() == "gists/public"), Args.EmptyDictionary, null); + gitHubClient.Connection.Received(1).Get>(Arg.Is(u => u.ToString() == "gists/public"), Args.EmptyDictionary); } [Fact] @@ -130,8 +129,7 @@ public void RequestsTheCorrectUrlWithApiOptions() }; client.GetAllPublic(options); - gitHubClient.Connection.Received(1).Get>(Arg.Is(u => u.ToString() == "gists/public"), - DictionaryWithApiOptions, null); + gitHubClient.Connection.Received(1).Get>(Arg.Is(u => u.ToString() == "gists/public"), DictionaryWithApiOptions); } [Fact] @@ -143,7 +141,7 @@ public void RequestsTheCorrectUrlWithSince() var since = DateTimeOffset.Now; client.GetAllPublic(since); - gitHubClient.Connection.Received(1).Get>(Arg.Is(u => u.ToString() == "gists/public"), DictionaryWithSince, null); + gitHubClient.Connection.Received(1).Get>(Arg.Is(u => u.ToString() == "gists/public"), DictionaryWithSince); } [Fact] @@ -161,8 +159,7 @@ public void RequestsTheCorrectUrlWithSinceAndApiOptions() var since = DateTimeOffset.Now; client.GetAllPublic(since, options); - gitHubClient.Connection.Received(1).Get>(Arg.Is(u => u.ToString() == "gists/public"), - DictionaryWithApiOptionsAndSince, null); + gitHubClient.Connection.Received(1).Get>(Arg.Is(u => u.ToString() == "gists/public"), DictionaryWithApiOptionsAndSince); } [Fact] @@ -185,7 +182,7 @@ public void RequestsTheCorrectUrl() client.GetAllStarred(); - gitHubClient.Connection.Received(1).Get>(Arg.Is(u => u.ToString() == "gists/starred"), Args.EmptyDictionary, null); + gitHubClient.Connection.Received(1).Get>(Arg.Is(u => u.ToString() == "gists/starred"), Args.EmptyDictionary); } [Fact] @@ -202,8 +199,7 @@ public void RequestsTheCorrectUrlWithApiOptions() }; client.GetAllStarred(options); - gitHubClient.Connection.Received(1).Get>(Arg.Is(u => u.ToString() == "gists/starred"), - DictionaryWithApiOptions, null); + gitHubClient.Connection.Received(1).Get>(Arg.Is(u => u.ToString() == "gists/starred"), DictionaryWithApiOptions); } [Fact] @@ -215,7 +211,7 @@ public void RequestsTheCorrectUrlWithSince() var since = DateTimeOffset.Now; client.GetAllStarred(since); - gitHubClient.Connection.Received(1).Get>(Arg.Is(u => u.ToString() == "gists/starred"), DictionaryWithSince, null); + gitHubClient.Connection.Received(1).Get>(Arg.Is(u => u.ToString() == "gists/starred"), DictionaryWithSince); } [Fact] @@ -233,8 +229,7 @@ public void RequestsTheCorrectUrlWithSinceAndApiOptions() var since = DateTimeOffset.Now; client.GetAllStarred(since, options); - gitHubClient.Connection.Received(1).Get>(Arg.Is(u => u.ToString() == "gists/starred"), - DictionaryWithApiOptionsAndSince, null); + gitHubClient.Connection.Received(1).Get>(Arg.Is(u => u.ToString() == "gists/starred"), DictionaryWithApiOptionsAndSince); } [Fact] @@ -257,7 +252,7 @@ public void RequestsTheCorrectUrl() client.GetAllForUser("samthedev"); - gitHubClient.Connection.Received(1).Get>(Arg.Is(u => u.ToString() == "users/samthedev/gists"), Args.EmptyDictionary, null); + gitHubClient.Connection.Received(1).Get>(Arg.Is(u => u.ToString() == "users/samthedev/gists"), Args.EmptyDictionary); } [Fact] @@ -274,8 +269,7 @@ public void RequestsTheCorrectUrlWithApiOptions() }; client.GetAllForUser("samthedev", options); - gitHubClient.Connection.Received(1).Get>(Arg.Is(u => u.ToString() == "users/samthedev/gists"), - DictionaryWithApiOptions, null); + gitHubClient.Connection.Received(1).Get>(Arg.Is(u => u.ToString() == "users/samthedev/gists"), DictionaryWithApiOptions); } [Fact] @@ -288,7 +282,7 @@ public void RequestsTheCorrectUrlWithSince() var user = "samthedev"; client.GetAllForUser(user, since); - gitHubClient.Connection.Received(1).Get>(Arg.Is(u => u.ToString() == "users/samthedev/gists"), DictionaryWithSince, null); + gitHubClient.Connection.Received(1).Get>(Arg.Is(u => u.ToString() == "users/samthedev/gists"), DictionaryWithSince); } [Fact] @@ -307,8 +301,7 @@ public void RequestsTheCorrectUrlWithSinceAndApiOptions() var user = "samthedev"; client.GetAllForUser(user, since, options); - gitHubClient.Connection.Received(1).Get>(Arg.Is(u => u.ToString() == "users/samthedev/gists"), - DictionaryWithApiOptionsAndSince, null); + gitHubClient.Connection.Received(1).Get>(Arg.Is(u => u.ToString() == "users/samthedev/gists"), DictionaryWithApiOptionsAndSince); } [Fact] @@ -335,7 +328,7 @@ public void RequestsTheCorrectUrl() client.GetAllCommits("id"); - gitHubClient.Connection.Received(1).Get>(Arg.Is(u => u.ToString() == "gists/id/commits"), Args.EmptyDictionary, null); + gitHubClient.Connection.Received(1).Get>(Arg.Is(u => u.ToString() == "gists/id/commits"), Args.EmptyDictionary); } [Fact] @@ -352,8 +345,7 @@ public void RequestsTheCorrectUrlWithApiOptions() }; client.GetAllCommits("id", options); - gitHubClient.Connection.Received(1).Get>(Arg.Is(u => u.ToString() == "gists/id/commits"), - DictionaryWithApiOptions, null); + gitHubClient.Connection.Received(1).Get>(Arg.Is(u => u.ToString() == "gists/id/commits"), DictionaryWithApiOptions); } @@ -379,7 +371,7 @@ public void RequestsTheCorrectUrl() client.GetAllForks("id"); - gitHubClient.Connection.Received(1).Get>(new Uri("gists/id/forks", UriKind.Relative), Args.EmptyDictionary, null); + gitHubClient.Connection.Received(1).Get>(new Uri("gists/id/forks", UriKind.Relative), Args.EmptyDictionary); } [Fact] @@ -396,8 +388,7 @@ public void RequestsTheCorrectUrlWithApiOptions() }; client.GetAllForks("id", options); - gitHubClient.Connection.Received(1).Get>(new Uri("gists/id/forks", UriKind.Relative), - DictionaryWithApiOptions, null); + gitHubClient.Connection.Received(1).Get>(new Uri("gists/id/forks", UriKind.Relative), DictionaryWithApiOptions); } diff --git a/Octokit.Tests/Reactive/ObservableGitHubAppInstallationsClientTests.cs b/Octokit.Tests/Reactive/ObservableGitHubAppInstallationsClientTests.cs index b32239ded4..64eee1d501 100644 --- a/Octokit.Tests/Reactive/ObservableGitHubAppInstallationsClientTests.cs +++ b/Octokit.Tests/Reactive/ObservableGitHubAppInstallationsClientTests.cs @@ -32,8 +32,7 @@ public void GetsFromCorrectUrl() connection.Received().Get>( Arg.Is(u => u.ToString() == "installation/repositories"), - Args.EmptyDictionary, - null); + Args.EmptyDictionary); } [Fact] @@ -54,8 +53,7 @@ public void GetsFromCorrectUrllWithApiOptions() Arg.Is(u => u.ToString() == "installation/repositories"), Arg.Is>(x => x.Count == 1 - && x["per_page"] == "1"), - null); + && x["per_page"] == "1")); } } @@ -72,12 +70,11 @@ public void GetsFromCorrectUrl() connection.Received().Get>( Arg.Is(u => u.ToString() == "user/installations/1234/repositories"), - Args.EmptyDictionary, - null); + Args.EmptyDictionary); } [Fact] - public void GetsFromCorrectUrllWithApiOptions() + public void GetsFromCorrectUrlWithApiOptions() { var connection = Substitute.For(); var gitHubClient = new GitHubClient(connection); @@ -94,8 +91,7 @@ public void GetsFromCorrectUrllWithApiOptions() Arg.Is(u => u.ToString() == "user/installations/1234/repositories"), Arg.Is>(x => x.Count == 1 - && x["per_page"] == "1"), - null); + && x["per_page"] == "1")); } } } diff --git a/Octokit.Tests/Reactive/ObservableGitHubAppsClientTests.cs b/Octokit.Tests/Reactive/ObservableGitHubAppsClientTests.cs index f5633dace5..ca6f27ffd7 100644 --- a/Octokit.Tests/Reactive/ObservableGitHubAppsClientTests.cs +++ b/Octokit.Tests/Reactive/ObservableGitHubAppsClientTests.cs @@ -86,8 +86,7 @@ public void RequestsCorrectUrl() connection.Received().Get>( Arg.Is(u => u.ToString() == "app/installations"), - Args.EmptyDictionary, - null); + Args.EmptyDictionary); } [Fact] @@ -108,8 +107,7 @@ public void RequestsTheCorrectUrlWithApiOptions() Arg.Is(u => u.ToString() == "app/installations"), Arg.Is>(x => x.Count == 1 - && x["per_page"] == "1"), - null); + && x["per_page"] == "1")); } } @@ -140,7 +138,6 @@ public void GetsFromCorrectUrl() connection.Received().Get>( Arg.Is(u => u.ToString() == "user/installations"), - null, null); } @@ -162,8 +159,7 @@ public void GetsFromCorrectUrlWithOptions() Arg.Is(u => u.ToString() == "user/installations"), Arg.Is>(x => x.Count == 1 - && x["per_page"] == "1"), - null); + && x["per_page"] == "1")); } } diff --git a/Octokit.Tests/Reactive/ObservableIssueCommentsClientTests.cs b/Octokit.Tests/Reactive/ObservableIssueCommentsClientTests.cs index 3c44e30ed1..26c16db495 100644 --- a/Octokit.Tests/Reactive/ObservableIssueCommentsClientTests.cs +++ b/Octokit.Tests/Reactive/ObservableIssueCommentsClientTests.cs @@ -58,8 +58,7 @@ public void RequestsCorrectUrl() gitHubClient.Connection.Received(1).Get>( new Uri("repos/fake/repo/issues/comments", UriKind.Relative), - Arg.Any>(), - null); + Arg.Any>()); } [Fact] @@ -72,8 +71,7 @@ public void RequestsCorrectUrlWithRepositoryId() gitHubClient.Connection.Received(1).Get>( new Uri("repositories/1/issues/comments", UriKind.Relative), - Arg.Any>(), - null); + Arg.Any>()); } [Fact] @@ -102,8 +100,7 @@ public void RequestsCorrectUrlWithApiOptions() Arg.Is>(d => d.Count == 5 && d["direction"] == "desc" && d["since"] == "2016-11-23T11:11:11Z" - && d["sort"] == "updated"), - null); + && d["sort"] == "updated")); } [Fact] @@ -132,8 +129,7 @@ public void RequestsCorrectUrlWithRepositoryIdWithApiOptions() Arg.Is>(d => d.Count == 5 && d["direction"] == "desc" && d["since"] == "2016-11-23T11:11:11Z" - && d["sort"] == "updated"), - null); + && d["sort"] == "updated")); } [Fact] @@ -171,8 +167,7 @@ public void RequestsCorrectUrl() gitHubClient.Connection.Received(1).Get>( new Uri("repos/fake/repo/issues/3/comments", UriKind.Relative), - Arg.Any>(), - null); + Arg.Any>()); } [Fact] @@ -184,8 +179,7 @@ public void RequestsCorrectUrlWithRepositoryId() client.GetAllForIssue(1, 3); gitHubClient.Connection.Received(1).Get>( - new Uri("repositories/1/issues/3/comments", UriKind.Relative), Arg.Any>(), - null); + new Uri("repositories/1/issues/3/comments", UriKind.Relative), Arg.Any>()); } [Fact] @@ -204,8 +198,7 @@ public void RequestsCorrectUrlWithIssueCommentRequest() gitHubClient.Connection.Received(1).Get>( new Uri("repos/fake/repo/issues/3/comments", UriKind.Relative), Arg.Is>(d => d.Count == 3 - && d["since"] == "2016-11-23T11:11:11Z"), - null); + && d["since"] == "2016-11-23T11:11:11Z")); } [Fact] @@ -224,8 +217,7 @@ public void RequestsCorrectUrlWithRepositoryIdWithIssueCommentRequest() gitHubClient.Connection.Received(1).Get>( new Uri("repositories/1/issues/3/comments", UriKind.Relative), Arg.Is>(d => d.Count == 3 - && d["since"] == "2016-11-23T11:11:11Z"), - null); + && d["since"] == "2016-11-23T11:11:11Z")); } [Fact] @@ -245,8 +237,7 @@ public void RequestsCorrectUrlWithApiOptions() gitHubClient.Connection.Received(1).Get>( new Uri("repos/fake/repo/issues/3/comments", UriKind.Relative), - Arg.Is>(d => d.Count == 4), - null); + Arg.Is>(d => d.Count == 4)); } [Fact] @@ -266,8 +257,7 @@ public void RequestsCorrectUrlWithRepositoryIdWithApiOptions() gitHubClient.Connection.Received(1).Get>( new Uri("repositories/1/issues/3/comments", UriKind.Relative), - Arg.Is>(d => d.Count == 4), - null); + Arg.Is>(d => d.Count == 4)); } [Fact] diff --git a/Octokit.Tests/Reactive/ObservableIssueTimelineClientTests.cs b/Octokit.Tests/Reactive/ObservableIssueTimelineClientTests.cs index b7f527c2c9..6e5ef0902c 100644 --- a/Octokit.Tests/Reactive/ObservableIssueTimelineClientTests.cs +++ b/Octokit.Tests/Reactive/ObservableIssueTimelineClientTests.cs @@ -38,14 +38,14 @@ public async Task RequestsCorrectUrl() IApiResponse> response = new ApiResponse>( CreateResponse(HttpStatusCode.OK), result); - gitHubClient.Connection.Get>(Args.Uri, Args.EmptyDictionary, null) + gitHubClient.Connection.Get>(Args.Uri, Args.EmptyDictionary) .Returns(Task.FromResult(response)); var timelineEvents = await client.GetAllForIssue("fake", "repo", 42).ToList(); connection.Received().Get>( Arg.Is(u => u.ToString() == "repos/fake/repo/issues/42/timeline"), - Arg.Any>(), null); + Arg.Any>()); Assert.Equal(1, timelineEvents.Count); } @@ -59,14 +59,14 @@ public async Task RequestsCorrectUrlWithApiOptions() var client = new ObservableIssueTimelineClient(gitHubClient); IApiResponse> response = new ApiResponse>(CreateResponse(HttpStatusCode.OK), result); - gitHubClient.Connection.Get>(Args.Uri, Arg.Is>(d => d.Count == 1), null) + gitHubClient.Connection.Get>(Args.Uri, Arg.Is>(d => d.Count == 1)) .Returns(Task.FromResult(response)); var timelineEvents = await client.GetAllForIssue("fake", "repo", 42, new ApiOptions { PageSize = 30 }).ToList(); connection.Received().Get>( Arg.Is(u => u.ToString() == "repos/fake/repo/issues/42/timeline"), - Arg.Is>(d => d.Count == 1 && d["per_page"] == "30"), null); + Arg.Is>(d => d.Count == 1 && d["per_page"] == "30")); Assert.Equal(1, timelineEvents.Count); } @@ -79,14 +79,14 @@ public async Task RequestCorrectUrlWithRepositoryId() var client = new ObservableIssueTimelineClient(githubClient); IApiResponse> response = new ApiResponse>(CreateResponse(HttpStatusCode.OK), result); - githubClient.Connection.Get>(Args.Uri, Args.EmptyDictionary, null) + githubClient.Connection.Get>(Args.Uri, Args.EmptyDictionary) .Returns(Task.FromResult(response)); var timelineEvents = await client.GetAllForIssue(1, 42).ToList(); connection.Received().Get>( Arg.Is(u => u.ToString() == "repositories/1/issues/42/timeline"), - Arg.Any>(), null); + Arg.Any>()); Assert.Equal(1, timelineEvents.Count); } @@ -99,14 +99,14 @@ public async Task RequestCorrectUrlWithRepositoryIdAndApiOptions() var client = new ObservableIssueTimelineClient(githubClient); IApiResponse> response = new ApiResponse>(CreateResponse(HttpStatusCode.OK), result); - githubClient.Connection.Get>(Args.Uri, Arg.Is>(d => d.Count == 1), null) + githubClient.Connection.Get>(Args.Uri, Arg.Is>(d => d.Count == 1)) .Returns(Task.FromResult(response)); var timelineEvents = await client.GetAllForIssue(1, 42, new ApiOptions { PageSize = 30 }).ToList(); connection.Received().Get>( Arg.Is(u => u.ToString() == "repositories/1/issues/42/timeline"), - Arg.Is>(d => d.Count == 1 && d["per_page"] == "30"), null); + Arg.Is>(d => d.Count == 1 && d["per_page"] == "30")); Assert.Equal(1, timelineEvents.Count); } diff --git a/Octokit.Tests/Reactive/ObservableIssuesClientTests.cs b/Octokit.Tests/Reactive/ObservableIssuesClientTests.cs index 6f71dc8d4d..347f17ad9f 100644 --- a/Octokit.Tests/Reactive/ObservableIssuesClientTests.cs +++ b/Octokit.Tests/Reactive/ObservableIssuesClientTests.cs @@ -97,7 +97,7 @@ public void RequestsCorrectUrl() client.GetAllForRepository("fake", "repo"); gitHubClient.Connection.Received().Get>(Arg.Is(u => u.ToString() == "repos/fake/repo/issues"), - Arg.Any>(), null); + Arg.Any>()); } [Fact] @@ -109,7 +109,7 @@ public void RequestsCorrectUrlWithRepositoryId() client.GetAllForRepository(1); gitHubClient.Connection.Received().Get>(Arg.Is(u => u.ToString() == "repositories/1/issues"), - Arg.Any>(), null); + Arg.Any>()); } [Fact] @@ -134,8 +134,7 @@ public void RequestsCorrectUrlWithApiOptions() && d["sort"] == "created" && d["direction"] == "desc" && d["page"] == "1" - && d["per_page"] == "1"), - null); + && d["per_page"] == "1")); } [Fact] @@ -160,7 +159,7 @@ public void RequestsCorrectUrlWithRepositoryIdWithApiOptions() && d["sort"] == "created" && d["direction"] == "desc" && d["page"] == "1" - && d["per_page"] == "1"), null); + && d["per_page"] == "1")); } [Fact] @@ -179,8 +178,7 @@ public void SendsAppropriateParameters() && d["filter"] == "assigned" && d["state"] == "open" && d["sort"] == "created" - && d["direction"] == "asc"), - null); + && d["direction"] == "asc")); } [Fact] @@ -199,7 +197,7 @@ public void SendsAppropriateParametersWithRepositoryId() && d["filter"] == "assigned" && d["state"] == "open" && d["sort"] == "created" - && d["direction"] == "asc"), null); + && d["direction"] == "asc")); } [Fact] @@ -227,8 +225,7 @@ public void SendsAppropriateParametersWithApiOptions() && d["sort"] == "created" && d["direction"] == "asc" && d["page"] == "1" - && d["per_page"] == "1"), - null); + && d["per_page"] == "1")); } [Fact] @@ -256,8 +253,7 @@ public void SendsAppropriateParametersWithRepositoryIdWithApiOptions() && d["sort"] == "created" && d["direction"] == "asc" && d["page"] == "1" - && d["per_page"] == "1"), - null); + && d["per_page"] == "1")); } [Fact] @@ -302,12 +298,11 @@ public async Task ReturnsEveryPageOfIssues() && d["direction"] == "desc" && d["state"] == "open" && d["sort"] == "created" - && d["filter"] == "assigned"), - null) + && d["filter"] == "assigned")) .Returns(Task.FromResult>>(firstPageResponse)); - gitHubClient.Connection.Get>(secondPageUrl, Arg.Any>(), null) + gitHubClient.Connection.Get>(secondPageUrl, Arg.Any>()) .Returns(Task.FromResult>>(secondPageResponse)); - gitHubClient.Connection.Get>(thirdPageUrl, Arg.Any>(), null) + gitHubClient.Connection.Get>(thirdPageUrl, Arg.Any>()) .Returns(Task.FromResult>>(lastPageResponse)); var client = new ObservableIssuesClient(gitHubClient); @@ -379,12 +374,11 @@ public async Task ReturnsEveryPageOfIssues() && d["direction"] == "desc" && d["state"] == "open" && d["sort"] == "created" - && d["filter"] == "assigned"), - null) + && d["filter"] == "assigned")) .Returns(Task.FromResult>>(firstPageResponse)); - gitHubClient.Connection.Get>(secondPageUrl, Arg.Any>(), null) + gitHubClient.Connection.Get>(secondPageUrl, Arg.Any>()) .Returns(Task.FromResult>>(secondPageResponse)); - gitHubClient.Connection.Get>(thirdPageUrl, Arg.Any>(), null) + gitHubClient.Connection.Get>(thirdPageUrl, Arg.Any>()) .Returns(Task.FromResult>>(lastPageResponse)); var client = new ObservableIssuesClient(gitHubClient); @@ -466,12 +460,11 @@ public async Task ReturnsEveryPageOfIssues() && d["direction"] == "desc" && d["state"] == "open" && d["sort"] == "created" - && d["filter"] == "assigned"), - null) + && d["filter"] == "assigned")) .Returns(Task.FromResult>>(firstPageResponse)); - gitHubClient.Connection.Get>(secondPageUrl, Arg.Any>(), null) + gitHubClient.Connection.Get>(secondPageUrl, Arg.Any>()) .Returns(Task.FromResult>>(secondPageResponse)); - gitHubClient.Connection.Get>(thirdPageUrl, Arg.Any>(), null) + gitHubClient.Connection.Get>(thirdPageUrl, Arg.Any>()) .Returns(Task.FromResult>>(lastPageResponse)); var client = new ObservableIssuesClient(gitHubClient); @@ -541,12 +534,11 @@ public async Task ReturnsEveryPageOfIssues() && d["direction"] == "desc" && d["state"] == "open" && d["sort"] == "created" - && d["filter"] == "assigned"), - null) + && d["filter"] == "assigned")) .Returns(Task.FromResult>>(firstPageResponse)); - gitHubClient.Connection.Get>(secondPageUrl, Arg.Any>(), null) + gitHubClient.Connection.Get>(secondPageUrl, Arg.Any>()) .Returns(Task.FromResult>>(secondPageResponse)); - gitHubClient.Connection.Get>(thirdPageUrl, Arg.Any>(), null) + gitHubClient.Connection.Get>(thirdPageUrl, Arg.Any>()) .Returns(Task.FromResult>>(lastPageResponse)); var client = new ObservableIssuesClient(gitHubClient); diff --git a/Octokit.Tests/Reactive/ObservableIssuesEventsClientTests.cs b/Octokit.Tests/Reactive/ObservableIssuesEventsClientTests.cs index 5674c45415..d03d98dfca 100644 --- a/Octokit.Tests/Reactive/ObservableIssuesEventsClientTests.cs +++ b/Octokit.Tests/Reactive/ObservableIssuesEventsClientTests.cs @@ -36,12 +36,12 @@ public async Task RequestsCorrectUrl() var client = new ObservableIssuesEventsClient(gitHubClient); IApiResponse> response = new ApiResponse>(CreateResponse(HttpStatusCode.OK), result); - gitHubClient.Connection.Get>(Args.Uri, Args.EmptyDictionary, null) + gitHubClient.Connection.Get>(Args.Uri, Args.EmptyDictionary) .Returns(Task.FromResult(response)); var eventInfos = await client.GetAllForIssue("fake", "repo", 42).ToList(); - connection.Received().Get>(Arg.Is(u => u.ToString() == "repos/fake/repo/issues/42/events"), Args.EmptyDictionary, null); + connection.Received().Get>(Arg.Is(u => u.ToString() == "repos/fake/repo/issues/42/events"), Args.EmptyDictionary); Assert.Equal(1, eventInfos.Count); } @@ -55,12 +55,12 @@ public async Task RequestsCorrectUrlWithRepositoryId() var client = new ObservableIssuesEventsClient(gitHubClient); IApiResponse> response = new ApiResponse>(CreateResponse(HttpStatusCode.OK), result); - gitHubClient.Connection.Get>(Args.Uri, Args.EmptyDictionary, null) + gitHubClient.Connection.Get>(Args.Uri, Args.EmptyDictionary) .Returns(Task.FromResult(response)); var eventInfos = await client.GetAllForIssue(1, 42).ToList(); - connection.Received().Get>(Arg.Is(u => u.ToString() == "repositories/1/issues/42/events"), Args.EmptyDictionary, null); + connection.Received().Get>(Arg.Is(u => u.ToString() == "repositories/1/issues/42/events"), Args.EmptyDictionary); Assert.Equal(1, eventInfos.Count); } @@ -81,12 +81,12 @@ public async Task RequestsCorrectUrlWithApiOptions() }; IApiResponse> response = new ApiResponse>(CreateResponse(HttpStatusCode.OK), result); - gitHubClient.Connection.Get>(Args.Uri, Arg.Is>(d => d.Count == 2), null) + gitHubClient.Connection.Get>(Args.Uri, Arg.Is>(d => d.Count == 2)) .Returns(Task.FromResult(response)); var eventInfos = await client.GetAllForIssue("fake", "repo", 42, options).ToList(); - connection.Received().Get>(Arg.Is(u => u.ToString() == "repos/fake/repo/issues/42/events"), Arg.Is>(d => d.Count == 2), null); + connection.Received().Get>(Arg.Is(u => u.ToString() == "repos/fake/repo/issues/42/events"), Arg.Is>(d => d.Count == 2)); Assert.Equal(1, eventInfos.Count); } @@ -108,12 +108,12 @@ public async Task RequestsCorrectUrlWithRepositoryIdWithApiOptions() IApiResponse> response = new ApiResponse>( CreateResponse(HttpStatusCode.OK), result); - gitHubClient.Connection.Get>(Args.Uri, Arg.Is>(d => d.Count == 2), null) + gitHubClient.Connection.Get>(Args.Uri, Arg.Is>(d => d.Count == 2)) .Returns(Task.FromResult(response)); var eventInfos = await client.GetAllForIssue(1, 42, options).ToList(); - connection.Received().Get>(Arg.Is(u => u.ToString() == "repositories/1/issues/42/events"), Arg.Is>(d => d.Count == 2), null); + connection.Received().Get>(Arg.Is(u => u.ToString() == "repositories/1/issues/42/events"), Arg.Is>(d => d.Count == 2)); Assert.Equal(1, eventInfos.Count); } @@ -149,12 +149,12 @@ public async Task RequestsCorrectUrl() var client = new ObservableIssuesEventsClient(gitHubClient); IApiResponse> response = new ApiResponse>(CreateResponse(HttpStatusCode.OK), result); - gitHubClient.Connection.Get>(Args.Uri, Args.EmptyDictionary, null) + gitHubClient.Connection.Get>(Args.Uri, Args.EmptyDictionary) .Returns(Task.FromResult(response)); var issueEvents = await client.GetAllForRepository("fake", "repo").ToList(); - connection.Received().Get>(Arg.Is(u => u.ToString() == "repos/fake/repo/issues/events"), Args.EmptyDictionary, null); + connection.Received().Get>(Arg.Is(u => u.ToString() == "repos/fake/repo/issues/events"), Args.EmptyDictionary); Assert.Equal(1, issueEvents.Count); } @@ -168,12 +168,12 @@ public async Task RequestsCorrectUrlWithRepositoryId() var client = new ObservableIssuesEventsClient(gitHubClient); IApiResponse> response = new ApiResponse>(CreateResponse(HttpStatusCode.OK), result); - gitHubClient.Connection.Get>(Args.Uri, Args.EmptyDictionary, null) + gitHubClient.Connection.Get>(Args.Uri, Args.EmptyDictionary) .Returns(Task.FromResult(response)); var issueEvents = await client.GetAllForRepository(1).ToList(); - connection.Received().Get>(Arg.Is(u => u.ToString() == "repositories/1/issues/events"), Args.EmptyDictionary, null); + connection.Received().Get>(Arg.Is(u => u.ToString() == "repositories/1/issues/events"), Args.EmptyDictionary); Assert.Equal(1, issueEvents.Count); } @@ -194,12 +194,12 @@ public async Task RequestsCorrectUrlWithApiOptions() }; IApiResponse> response = new ApiResponse>(CreateResponse(HttpStatusCode.OK), result); - gitHubClient.Connection.Get>(Args.Uri, Arg.Is>(d => d.Count == 2), null) + gitHubClient.Connection.Get>(Args.Uri, Arg.Is>(d => d.Count == 2)) .Returns(Task.FromResult(response)); var issueEvents = await client.GetAllForRepository("fake", "repo", options).ToList(); - connection.Received().Get>(Arg.Is(u => u.ToString() == "repos/fake/repo/issues/events"), Arg.Is>(d => d.Count == 2), null); + connection.Received().Get>(Arg.Is(u => u.ToString() == "repos/fake/repo/issues/events"), Arg.Is>(d => d.Count == 2)); Assert.Equal(1, issueEvents.Count); } @@ -220,12 +220,12 @@ public async Task RequestsCorrectUrlWithRepositoryIdWithApiOptions() }; IApiResponse> response = new ApiResponse>(CreateResponse(HttpStatusCode.OK), result); - gitHubClient.Connection.Get>(Args.Uri, Arg.Is>(d => d.Count == 2), null) + gitHubClient.Connection.Get>(Args.Uri, Arg.Is>(d => d.Count == 2)) .Returns(Task.FromResult(response)); var issueEvents = await client.GetAllForRepository(1, options).ToList(); - connection.Received().Get>(Arg.Is(u => u.ToString() == "repositories/1/issues/events"), Arg.Is>(d => d.Count == 2), null); + connection.Received().Get>(Arg.Is(u => u.ToString() == "repositories/1/issues/events"), Arg.Is>(d => d.Count == 2)); Assert.Equal(1, issueEvents.Count); } diff --git a/Octokit.Tests/Reactive/ObservableIssuesLabelsClientTests.cs b/Octokit.Tests/Reactive/ObservableIssuesLabelsClientTests.cs index c075028d0e..81b8ac940b 100644 --- a/Octokit.Tests/Reactive/ObservableIssuesLabelsClientTests.cs +++ b/Octokit.Tests/Reactive/ObservableIssuesLabelsClientTests.cs @@ -30,7 +30,7 @@ public async Task RequestsCorrectUrl() client.GetAllForIssue("fake", "repo", 42); - connection.Received().Get>(Arg.Is(u => u.ToString() == "repos/fake/repo/issues/42/labels"), Args.EmptyDictionary, null); + connection.Received().Get>(Arg.Is(u => u.ToString() == "repos/fake/repo/issues/42/labels"), Args.EmptyDictionary); } [Fact] @@ -42,7 +42,7 @@ public async Task RequestsCorrectUrlWithRepositoryId() client.GetAllForIssue(1, 42); - connection.Received().Get>(Arg.Is(u => u.ToString() == "repositories/1/issues/42/labels"), Args.EmptyDictionary, null); + connection.Received().Get>(Arg.Is(u => u.ToString() == "repositories/1/issues/42/labels"), Args.EmptyDictionary); } [Fact] @@ -61,7 +61,7 @@ public async Task RequestsCorrectUrlWithApiOptions() client.GetAllForIssue("fake", "repo", 42, options); - connection.Received().Get>(Arg.Is(u => u.ToString() == "repos/fake/repo/issues/42/labels"), Arg.Is>(d => d.Count == 2), null); + connection.Received().Get>(Arg.Is(u => u.ToString() == "repos/fake/repo/issues/42/labels"), Arg.Is>(d => d.Count == 2)); } [Fact] @@ -80,7 +80,7 @@ public async Task RequestsCorrectUrlWithApiOptionsWithRepositoryId() client.GetAllForIssue(1, 42, options); - connection.Received().Get>(Arg.Is(u => u.ToString() == "repositories/1/issues/42/labels"), Arg.Is>(d => d.Count == 2), null); + connection.Received().Get>(Arg.Is(u => u.ToString() == "repositories/1/issues/42/labels"), Arg.Is>(d => d.Count == 2)); } [Fact] @@ -114,7 +114,7 @@ public async Task RequestsCorrectUrl() client.GetAllForRepository("fake", "repo"); - connection.Received().Get>(Arg.Is(u => u.ToString() == "repos/fake/repo/labels"), Args.EmptyDictionary, null); + connection.Received().Get>(Arg.Is(u => u.ToString() == "repos/fake/repo/labels"), Args.EmptyDictionary); } [Fact] @@ -126,7 +126,7 @@ public async Task RequestsCorrectUrlWithRepositoryId() client.GetAllForRepository(1); - connection.Received().Get>(Arg.Is(u => u.ToString() == "repositories/1/labels"), Args.EmptyDictionary, null); + connection.Received().Get>(Arg.Is(u => u.ToString() == "repositories/1/labels"), Args.EmptyDictionary); } [Fact] @@ -145,7 +145,7 @@ public async Task RequestsCorrectUrlWithApiOptions() client.GetAllForRepository("fake", "repo", options); - connection.Received().Get>(Arg.Is(u => u.ToString() == "repos/fake/repo/labels"), Arg.Is>(d => d.Count == 2), null); + connection.Received().Get>(Arg.Is(u => u.ToString() == "repos/fake/repo/labels"), Arg.Is>(d => d.Count == 2)); } [Fact] @@ -164,7 +164,7 @@ public async Task RequestsCorrectUrlWithApiOptionsWithRepositoryId() client.GetAllForRepository(1, options); - connection.Received().Get>(Arg.Is(u => u.ToString() == "repositories/1/labels"), Arg.Is>(d => d.Count == 2), null); + connection.Received().Get>(Arg.Is(u => u.ToString() == "repositories/1/labels"), Arg.Is>(d => d.Count == 2)); } [Fact] @@ -198,7 +198,7 @@ public async Task RequestsCorrectUrl() client.GetAllForMilestone("fake", "repo", 42); - connection.Received().Get>(Arg.Is(u => u.ToString() == "repos/fake/repo/milestones/42/labels"), Args.EmptyDictionary, null); + connection.Received().Get>(Arg.Is(u => u.ToString() == "repos/fake/repo/milestones/42/labels"), Args.EmptyDictionary); } [Fact] @@ -210,7 +210,7 @@ public async Task RequestsCorrectUrlWithRepositoryId() client.GetAllForMilestone(1, 42); - connection.Received().Get>(Arg.Is(u => u.ToString() == "repositories/1/milestones/42/labels"), Args.EmptyDictionary, null); + connection.Received().Get>(Arg.Is(u => u.ToString() == "repositories/1/milestones/42/labels"), Args.EmptyDictionary); } [Fact] @@ -229,7 +229,7 @@ public async Task RequestsCorrectUrlWithApiOptions() client.GetAllForMilestone("fake", "repo", 42, options); - connection.Received().Get>(Arg.Is(u => u.ToString() == "repos/fake/repo/milestones/42/labels"), Arg.Is>(d => d.Count == 2), null); + connection.Received().Get>(Arg.Is(u => u.ToString() == "repos/fake/repo/milestones/42/labels"), Arg.Is>(d => d.Count == 2)); } [Fact] @@ -248,7 +248,7 @@ public async Task RequestsCorrectUrlWithApiOptionsWithRepositoryId() client.GetAllForMilestone(1, 42, options); - connection.Received().Get>(Arg.Is(u => u.ToString() == "repositories/1/milestones/42/labels"), Arg.Is>(d => d.Count == 2), null); + connection.Received().Get>(Arg.Is(u => u.ToString() == "repositories/1/milestones/42/labels"), Arg.Is>(d => d.Count == 2)); } [Fact] diff --git a/Octokit.Tests/Reactive/ObservableMilestonesClientTests.cs b/Octokit.Tests/Reactive/ObservableMilestonesClientTests.cs index e7c70f1963..5780a494e0 100644 --- a/Octokit.Tests/Reactive/ObservableMilestonesClientTests.cs +++ b/Octokit.Tests/Reactive/ObservableMilestonesClientTests.cs @@ -250,11 +250,11 @@ public async Task ReturnsEveryPageOfMilestones() } ); var gitHubClient = Substitute.For(); - gitHubClient.Connection.Get>(firstPageUrl, Args.EmptyDictionary, null) + gitHubClient.Connection.Get>(firstPageUrl, Args.EmptyDictionary) .Returns(Task.FromResult>>(firstPageResponse)); - gitHubClient.Connection.Get>(secondPageUrl, Args.EmptyDictionary, null) + gitHubClient.Connection.Get>(secondPageUrl, Args.EmptyDictionary) .Returns(Task.FromResult>>(secondPageResponse)); - gitHubClient.Connection.Get>(thirdPageUrl, Args.EmptyDictionary, null) + gitHubClient.Connection.Get>(thirdPageUrl, Args.EmptyDictionary) .Returns(Task.FromResult>>(lastPageResponse)); var client = new ObservableMilestonesClient(gitHubClient); @@ -307,17 +307,17 @@ public async Task SendsAppropriateParametersMulti() Arg.Is>(d => d.Count == 3 && d["direction"] == "desc" && d["state"] == "open" - && d["sort"] == "due_date"), null) + && d["sort"] == "due_date")) .Returns(Task.FromResult>>(firstPageResponse)); gitHubClient.Connection.Get>(secondPageUrl, Arg.Is>(d => d.Count == 3 && d["direction"] == "desc" && d["state"] == "open" - && d["sort"] == "due_date"), null) + && d["sort"] == "due_date")) .Returns(Task.FromResult>>(secondPageResponse)); gitHubClient.Connection.Get>(thirdPageUrl, Arg.Is>(d => d.Count == 3 && d["direction"] == "desc" && d["state"] == "open" - && d["sort"] == "due_date"), null) + && d["sort"] == "due_date")) .Returns(Task.FromResult>>(lastPageResponse)); var client = new ObservableMilestonesClient(gitHubClient); diff --git a/Octokit.Tests/Reactive/ObservableNotificationsClientTests.cs b/Octokit.Tests/Reactive/ObservableNotificationsClientTests.cs index cbcd97c6f3..22afb7c7d9 100644 --- a/Octokit.Tests/Reactive/ObservableNotificationsClientTests.cs +++ b/Octokit.Tests/Reactive/ObservableNotificationsClientTests.cs @@ -31,7 +31,7 @@ public void RequestsCorrectUrl() client.GetAllForCurrent(); - connection.Received().Get>(endpoint, Args.EmptyDictionary, null); + connection.Received().Get>(endpoint, Args.EmptyDictionary); } [Fact] @@ -51,7 +51,7 @@ public void RequestsCorrectUrlApiOptions() client.GetAllForCurrent(options); - connection.Received().Get>(endpoint, Arg.Is>(d => d.Count == 2), null); + connection.Received().Get>(endpoint, Arg.Is>(d => d.Count == 2)); } [Fact] @@ -66,8 +66,8 @@ public void RequestsCorrectUrlNotificationRequest() client.GetAllForCurrent(notificationsRequest); - connection.Received().Get>(endpoint, Arg.Is>(d => d.Count == 2 - && d["all"] == "true" && d["participating"] == "false"), null); + connection.Received().Get>(endpoint, + Arg.Is>(d => d.Count == 2 && d["all"] == "true" && d["participating"] == "false")); } [Fact] @@ -89,9 +89,11 @@ public void RequestsCorrectUrlNotificationRequestWithApiOptions() client.GetAllForCurrent(notificationsRequest, options); - connection.Received().Get>(endpoint, Arg.Is>(d => d.Count == 4 - && d["all"] == "true" && d["participating"] == "false" - && d["page"] == "1" && d["per_page"] == "1"), null); + connection.Received().Get>(endpoint, + Arg.Is>(d => + d.Count == 4 + && d["all"] == "true" && d["participating"] == "false" + && d["page"] == "1" && d["per_page"] == "1")); } [Fact] @@ -116,7 +118,7 @@ public void RequestsCorrectUrl() client.GetAllForRepository("banana", "split"); - connection.Received().Get>(endpoint, Args.EmptyDictionary, null); + connection.Received().Get>(endpoint, Args.EmptyDictionary); } [Fact] @@ -129,7 +131,7 @@ public void RequestsCorrectUrlWithRepositoryId() client.GetAllForRepository(1); - connection.Received().Get>(endpoint, Args.EmptyDictionary, null); + connection.Received().Get>(endpoint, Args.EmptyDictionary); } [Fact] @@ -149,7 +151,7 @@ public void RequestsCorrectUrlWithApiOptions() client.GetAllForRepository("banana", "split", options); - connection.Received().Get>(endpoint, Arg.Is>(d => d.Count == 2), null); + connection.Received().Get>(endpoint, Arg.Is>(d => d.Count == 2)); } [Fact] @@ -169,7 +171,7 @@ public void RequestsCorrectUrlWithApiOptionsWithRepositoryId() client.GetAllForRepository(1, options); - connection.Received().Get>(endpoint, Arg.Is>(d => d.Count == 2), null); + connection.Received().Get>(endpoint, Arg.Is>(d => d.Count == 2)); } [Fact] @@ -185,8 +187,7 @@ public void RequestsCorrectUrlNotificationRequest() client.GetAllForRepository("banana", "split", notificationsRequest); connection.Received().Get>(endpoint, Arg.Is>( - d => d.Count == 2 && d["all"] == "true" && d["participating"] == "false"), - null); + d => d.Count == 2 && d["all"] == "true" && d["participating"] == "false")); } [Fact] @@ -202,8 +203,7 @@ public void RequestsCorrectUrlNotificationRequestWithRepositoryId() client.GetAllForRepository(1, notificationsRequest); connection.Received().Get>(endpoint, Arg.Is>( - d => d.Count == 2 && d["all"] == "true" && d["participating"] == "false"), - null); + d => d.Count == 2 && d["all"] == "true" && d["participating"] == "false")); } [Fact] @@ -227,8 +227,7 @@ public void RequestsCorrectUrlNotificationRequestWithApiOptions() connection.Received().Get>(endpoint, Arg.Is>( d => d.Count == 4 && d["all"] == "true" && d["participating"] == "false" - && d["page"] == "1" && d["per_page"] == "1"), - null); + && d["page"] == "1" && d["per_page"] == "1")); } [Fact] @@ -252,8 +251,7 @@ public void RequestsCorrectUrlNotificationRequestWithApiOptionsWithRepositoryId( connection.Received().Get>(endpoint, Arg.Is>( d => d.Count == 4 && d["all"] == "true" && d["participating"] == "false" - && d["page"] == "1" && d["per_page"] == "1"), - null); + && d["page"] == "1" && d["per_page"] == "1")); } [Fact] diff --git a/Octokit.Tests/Reactive/ObservableOrganizationMembersClientTests.cs b/Octokit.Tests/Reactive/ObservableOrganizationMembersClientTests.cs index 5d50ca20e0..b06b3f9e58 100644 --- a/Octokit.Tests/Reactive/ObservableOrganizationMembersClientTests.cs +++ b/Octokit.Tests/Reactive/ObservableOrganizationMembersClientTests.cs @@ -32,7 +32,7 @@ public void RequestsCorrectUrl() client.GetAll("org"); gitHubClient.Connection.Received(1).Get>( - new Uri("orgs/org/members", UriKind.Relative), Args.EmptyDictionary, null); + new Uri("orgs/org/members", UriKind.Relative), Args.EmptyDictionary); } [Fact] @@ -51,7 +51,7 @@ public void RequestsCorrectUrlWithApiOptions() client.GetAll("org", options); gitHubClient.Connection.Received(1).Get>( - new Uri("orgs/org/members", UriKind.Relative), Arg.Is>(d => d.Count == 2), null); + new Uri("orgs/org/members", UriKind.Relative), Arg.Is>(d => d.Count == 2)); } [Fact] @@ -96,7 +96,7 @@ public void TwoFactorFilterRequestTheCorrectUrlWithApiOptions() orgMembersClient.GetAll("org", OrganizationMembersFilter.TwoFactorAuthenticationDisabled, options); client.Connection.Received(1).Get>( - new Uri("orgs/org/members?filter=2fa_disabled", UriKind.Relative), Arg.Is>(d => d.Count == 2), null); + new Uri("orgs/org/members?filter=2fa_disabled", UriKind.Relative), Arg.Is>(d => d.Count == 2)); } [Fact] @@ -114,7 +114,7 @@ public void MemberRoleFilterRequestTheCorrectUrlWithApiOptions() orgMembersClient.GetAll("org", OrganizationMembersRole.Member, options); - client.Connection.Received().Get>(Arg.Is(u => u.ToString() == "orgs/org/members?role=member"), Arg.Is>(d => d.Count == 2), null); + client.Connection.Received().Get>(Arg.Is(u => u.ToString() == "orgs/org/members?role=member"), Arg.Is>(d => d.Count == 2)); } [Fact] @@ -132,7 +132,7 @@ public void TwoFactorFilterPlusMemberRoleRequestTheCorrectUrlWithApiOptions() orgMembersClient.GetAll("org", OrganizationMembersFilter.TwoFactorAuthenticationDisabled, OrganizationMembersRole.Member, options); - client.Connection.Received().Get>(Arg.Is(u => u.ToString() == "orgs/org/members?filter=2fa_disabled&role=member"), Arg.Is>(d => d.Count == 2), null); + client.Connection.Received().Get>(Arg.Is(u => u.ToString() == "orgs/org/members?filter=2fa_disabled&role=member"), Arg.Is>(d => d.Count == 2)); } } @@ -147,7 +147,7 @@ public void RequestsTheCorrectUrl() client.GetAllPublic("org"); gitHubClient.Connection.Received(1).Get>( - new Uri("orgs/org/public_members", UriKind.Relative), Args.EmptyDictionary, null); + new Uri("orgs/org/public_members", UriKind.Relative), Args.EmptyDictionary); } [Fact] @@ -166,7 +166,7 @@ public void RequestsTheCorrectUrlWithApiOptions() client.GetAllPublic("org", options); gitHubClient.Connection.Received(1).Get>( - new Uri("orgs/org/public_members", UriKind.Relative), Arg.Is>(d => d.Count == 2), null); + new Uri("orgs/org/public_members", UriKind.Relative), Arg.Is>(d => d.Count == 2)); } [Fact] diff --git a/Octokit.Tests/Reactive/ObservableOrganizationOutsideCollaboratorsClientTests.cs b/Octokit.Tests/Reactive/ObservableOrganizationOutsideCollaboratorsClientTests.cs index bc6c8457c7..06d34c64b8 100644 --- a/Octokit.Tests/Reactive/ObservableOrganizationOutsideCollaboratorsClientTests.cs +++ b/Octokit.Tests/Reactive/ObservableOrganizationOutsideCollaboratorsClientTests.cs @@ -31,8 +31,7 @@ public void RequestsTheCorrectUrl() gitHubClient.Connection.Received(1).Get>( Arg.Is(u => u.ToString() == "orgs/org/outside_collaborators"), - Args.EmptyDictionary, - null); + Args.EmptyDictionary); } [Fact] @@ -52,8 +51,7 @@ public void RequestsTheCorrectUrlWithApiOptions() gitHubClient.Connection.Received(1).Get>( Arg.Is(u => u.ToString() == "orgs/org/outside_collaborators"), - Arg.Is>(d => d.Count == 2), - null); + Arg.Is>(d => d.Count == 2)); } [Fact] @@ -87,8 +85,7 @@ public void AllFilterRequestsTheCorrectUrl() gitHubClient.Connection.Received(1).Get>( Arg.Is(u => u.ToString() == "orgs/org/outside_collaborators?filter=all"), - Args.EmptyDictionary, - null); + Args.EmptyDictionary); } [Fact] @@ -108,8 +105,7 @@ public void AllFilterRequestsTheCorrectUrlWithApiOptions() gitHubClient.Connection.Received(1).Get>( Arg.Is(u => u.ToString() == "orgs/org/outside_collaborators?filter=all"), - Arg.Is>(d => d.Count == 2), - null); + Arg.Is>(d => d.Count == 2)); } [Fact] @@ -122,8 +118,7 @@ public void TwoFactorFilterRequestsTheCorrectUrl() gitHubClient.Connection.Received(1).Get>( Arg.Is(u => u.ToString() == "orgs/org/outside_collaborators?filter=2fa_disabled"), - Args.EmptyDictionary, - null); + Args.EmptyDictionary); } [Fact] @@ -143,8 +138,7 @@ public void TwoFactorFilterRequestsTheCorrectUrlWithApiOptions() gitHubClient.Connection.Received(1).Get>( Arg.Is(u => u.ToString() == "orgs/org/outside_collaborators?filter=2fa_disabled"), - Arg.Is>(d => d.Count == 2), - null); + Arg.Is>(d => d.Count == 2)); } } diff --git a/Octokit.Tests/Reactive/ObservableProjectCardsClientTests.cs b/Octokit.Tests/Reactive/ObservableProjectCardsClientTests.cs index 17f7c8c617..94a54b7cf3 100644 --- a/Octokit.Tests/Reactive/ObservableProjectCardsClientTests.cs +++ b/Octokit.Tests/Reactive/ObservableProjectCardsClientTests.cs @@ -33,8 +33,7 @@ public void RequestCorrectURL() connection.Received().Get>( Arg.Is(u => u.ToString() == "projects/columns/1/cards"), - Args.EmptyDictionary, - null); + Args.EmptyDictionary); } [Fact] @@ -50,8 +49,7 @@ public async Task SendsAppropriateParameters() Arg.Is(u => u.ToString() == "projects/columns/1/cards"), Arg.Is>(x => x.Count == 1 - && x["archived_state"] == "not_archived"), - null); + && x["archived_state"] == "not_archived")); } [Fact] diff --git a/Octokit.Tests/Reactive/ObservableProjectColumnsClientTests.cs b/Octokit.Tests/Reactive/ObservableProjectColumnsClientTests.cs index 0e74aa485e..d370a19db0 100644 --- a/Octokit.Tests/Reactive/ObservableProjectColumnsClientTests.cs +++ b/Octokit.Tests/Reactive/ObservableProjectColumnsClientTests.cs @@ -33,8 +33,7 @@ public void RequestCorrectURL() connection.Received().Get>( Arg.Is(u => u.ToString() == "projects/1/columns"), - Args.EmptyDictionary, - null); + Args.EmptyDictionary); } [Fact] diff --git a/Octokit.Tests/Reactive/ObservableProjectsClientTests.cs b/Octokit.Tests/Reactive/ObservableProjectsClientTests.cs index 2b31566113..3f2bef6898 100644 --- a/Octokit.Tests/Reactive/ObservableProjectsClientTests.cs +++ b/Octokit.Tests/Reactive/ObservableProjectsClientTests.cs @@ -34,8 +34,7 @@ public void RequestCorrectUrl() connection.Received().Get>( Arg.Is(u => u.ToString() == "repos/owner/repo/projects"), - Args.EmptyDictionary, - null); + Args.EmptyDictionary); } [Fact] @@ -49,8 +48,7 @@ public void RequestCorrectUrlWithRequestParameter() connection.Received().Get>( Arg.Is(u => u.ToString() == "repos/owner/repo/projects"), - Arg.Is>(d => d.ContainsKey("state")), - null); + Arg.Is>(d => d.ContainsKey("state"))); } [Fact] @@ -64,8 +62,7 @@ public void RequestCorrectUrlWithRepositoryId() connection.Received().Get>( Arg.Is(u => u.ToString() == "repositories/1/projects"), - Args.EmptyDictionary, - null); + Args.EmptyDictionary); } [Fact] @@ -79,8 +76,7 @@ public void RequestCorrectUrlWithRequestParameterWithRepositoryId() connection.Received().Get>( Arg.Is(u => u.ToString() == "repositories/1/projects"), - Arg.Is>(d => d.ContainsKey("state")), - null); + Arg.Is>(d => d.ContainsKey("state"))); } [Fact] @@ -131,8 +127,7 @@ public void RequestCorrectUrl() connection.Received().Get>( Arg.Is(u => u.ToString() == "orgs/org/projects"), - Args.EmptyDictionary, - null); + Args.EmptyDictionary); } [Fact] @@ -146,8 +141,7 @@ public void RequestCorrectUrlWithRequestParameter() connection.Received().Get>( Arg.Is(u => u.ToString() == "orgs/org/projects"), - Arg.Is>(d => d.ContainsKey("state")), - null); + Arg.Is>(d => d.ContainsKey("state"))); } [Fact] diff --git a/Octokit.Tests/Reactive/ObservablePullRequestReviewCommentsClientTests.cs b/Octokit.Tests/Reactive/ObservablePullRequestReviewCommentsClientTests.cs index a88f4ee22b..5c813929a6 100644 --- a/Octokit.Tests/Reactive/ObservablePullRequestReviewCommentsClientTests.cs +++ b/Octokit.Tests/Reactive/ObservablePullRequestReviewCommentsClientTests.cs @@ -128,11 +128,11 @@ public async Task RequestsCorrectUrlMulti() ); var gitHubClient = Substitute.For(); - gitHubClient.Connection.Get>(firstPageUrl, Args.EmptyDictionary, null) + gitHubClient.Connection.Get>(firstPageUrl, Args.EmptyDictionary) .Returns(Task.FromResult>>(firstPageResponse)); - gitHubClient.Connection.Get>(secondPageUrl, Args.EmptyDictionary, null) + gitHubClient.Connection.Get>(secondPageUrl, Args.EmptyDictionary) .Returns(Task.FromResult>>(secondPageResponse)); - gitHubClient.Connection.Get>(thirdPageUrl, Args.EmptyDictionary, null) + gitHubClient.Connection.Get>(thirdPageUrl, Args.EmptyDictionary) .Returns(Task.FromResult>>(lastPageResponse)); var client = new ObservablePullRequestReviewCommentsClient(gitHubClient); @@ -140,9 +140,9 @@ public async Task RequestsCorrectUrlMulti() var results = await client.GetAll("owner", "name", 7).ToArray(); Assert.Equal(7, results.Length); - gitHubClient.Connection.Received(1).Get>(firstPageUrl, Args.EmptyDictionary, null); - gitHubClient.Connection.Received(1).Get>(secondPageUrl, Args.EmptyDictionary, null); - gitHubClient.Connection.Received(1).Get>(thirdPageUrl, Args.EmptyDictionary, null); + gitHubClient.Connection.Received(1).Get>(firstPageUrl, Args.EmptyDictionary); + gitHubClient.Connection.Received(1).Get>(secondPageUrl, Args.EmptyDictionary); + gitHubClient.Connection.Received(1).Get>(thirdPageUrl, Args.EmptyDictionary); } [Fact] @@ -182,11 +182,11 @@ public async Task RequestsCorrectUrlMultiWithRepositoryId() ); var gitHubClient = Substitute.For(); - gitHubClient.Connection.Get>(firstPageUrl, Args.EmptyDictionary, null) + gitHubClient.Connection.Get>(firstPageUrl, Args.EmptyDictionary) .Returns(Task.FromResult>>(firstPageResponse)); - gitHubClient.Connection.Get>(secondPageUrl, Args.EmptyDictionary, null) + gitHubClient.Connection.Get>(secondPageUrl, Args.EmptyDictionary) .Returns(Task.FromResult>>(secondPageResponse)); - gitHubClient.Connection.Get>(thirdPageUrl, Args.EmptyDictionary, null) + gitHubClient.Connection.Get>(thirdPageUrl, Args.EmptyDictionary) .Returns(Task.FromResult>>(lastPageResponse)); var client = new ObservablePullRequestReviewCommentsClient(gitHubClient); @@ -194,9 +194,9 @@ public async Task RequestsCorrectUrlMultiWithRepositoryId() var results = await client.GetAll(1, 7).ToArray(); Assert.Equal(7, results.Length); - gitHubClient.Connection.Received(1).Get>(firstPageUrl, Args.EmptyDictionary, null); - gitHubClient.Connection.Received(1).Get>(secondPageUrl, Args.EmptyDictionary, null); - gitHubClient.Connection.Received(1).Get>(thirdPageUrl, Args.EmptyDictionary, null); + gitHubClient.Connection.Received(1).Get>(firstPageUrl, Args.EmptyDictionary); + gitHubClient.Connection.Received(1).Get>(secondPageUrl, Args.EmptyDictionary); + gitHubClient.Connection.Received(1).Get>(thirdPageUrl, Args.EmptyDictionary); } [Fact] @@ -351,17 +351,17 @@ public async Task RequestsCorrectUrlMulti() Arg.Is>(d => d.Count == 3 && d["direction"] == "desc" && d["since"] == "2013-11-15T11:43:01Z" - && d["sort"] == "updated"), null) + && d["sort"] == "updated")) .Returns(Task.FromResult>>(firstPageResponse)); gitHubClient.Connection.Get>(secondPageUrl, Arg.Is>(d => d.Count == 3 && d["direction"] == "desc" && d["since"] == "2013-11-15T11:43:01Z" - && d["sort"] == "updated"), null) + && d["sort"] == "updated")) .Returns(Task.FromResult>>(secondPageResponse)); gitHubClient.Connection.Get>(thirdPageUrl, Arg.Is>(d => d.Count == 3 && d["direction"] == "desc" && d["since"] == "2013-11-15T11:43:01Z" - && d["sort"] == "updated"), null) + && d["sort"] == "updated")) .Returns(Task.FromResult>>(lastPageResponse)); var client = new ObservablePullRequestReviewCommentsClient(gitHubClient); @@ -380,15 +380,15 @@ public async Task RequestsCorrectUrlMulti() Arg.Is>(d => d.Count == 3 && d["direction"] == "desc" && d["since"] == "2013-11-15T11:43:01Z" - && d["sort"] == "updated"), null); + && d["sort"] == "updated")); gitHubClient.Connection.Received(1).Get>(secondPageUrl, Arg.Is>(d => d.Count == 3 && d["direction"] == "desc" && d["since"] == "2013-11-15T11:43:01Z" - && d["sort"] == "updated"), null); + && d["sort"] == "updated")); gitHubClient.Connection.Received(1).Get>(thirdPageUrl, Arg.Is>(d => d.Count == 3 && d["direction"] == "desc" && d["since"] == "2013-11-15T11:43:01Z" - && d["sort"] == "updated"), null); + && d["sort"] == "updated")); } [Fact] @@ -434,17 +434,17 @@ public async Task RequestsCorrectUrlMultiWithRepositoryId() Arg.Is>(d => d.Count == 3 && d["direction"] == "desc" && d["since"] == "2013-11-15T11:43:01Z" - && d["sort"] == "updated"), null) + && d["sort"] == "updated")) .Returns(Task.FromResult>>(firstPageResponse)); gitHubClient.Connection.Get>(secondPageUrl, Arg.Is>(d => d.Count == 3 && d["direction"] == "desc" && d["since"] == "2013-11-15T11:43:01Z" - && d["sort"] == "updated"), null) + && d["sort"] == "updated")) .Returns(Task.FromResult>>(secondPageResponse)); gitHubClient.Connection.Get>(thirdPageUrl, Arg.Is>(d => d.Count == 3 && d["direction"] == "desc" && d["since"] == "2013-11-15T11:43:01Z" - && d["sort"] == "updated"), null) + && d["sort"] == "updated")) .Returns(Task.FromResult>>(lastPageResponse)); var client = new ObservablePullRequestReviewCommentsClient(gitHubClient); @@ -463,15 +463,15 @@ public async Task RequestsCorrectUrlMultiWithRepositoryId() Arg.Is>(d => d.Count == 3 && d["direction"] == "desc" && d["since"] == "2013-11-15T11:43:01Z" - && d["sort"] == "updated"), null); + && d["sort"] == "updated")); gitHubClient.Connection.Received(1).Get>(secondPageUrl, Arg.Is>(d => d.Count == 3 && d["direction"] == "desc" && d["since"] == "2013-11-15T11:43:01Z" - && d["sort"] == "updated"), null); + && d["sort"] == "updated")); gitHubClient.Connection.Received(1).Get>(thirdPageUrl, Arg.Is>(d => d.Count == 3 && d["direction"] == "desc" && d["since"] == "2013-11-15T11:43:01Z" - && d["sort"] == "updated"), null); + && d["sort"] == "updated")); } [Fact] @@ -574,15 +574,15 @@ public async Task RequestsCorrectUrlWithoutSelectedSortingArgumentsMulti() gitHubClient.Connection.Get>(firstPageUrl, Arg.Is>(d => d.Count == 2 && d["direction"] == "asc" - && d["sort"] == "created"), null) + && d["sort"] == "created")) .Returns(Task.FromResult>>(firstPageResponse)); gitHubClient.Connection.Get>(secondPageUrl, Arg.Is>(d => d.Count == 2 && d["direction"] == "asc" - && d["sort"] == "created"), null) + && d["sort"] == "created")) .Returns(Task.FromResult>>(secondPageResponse)); gitHubClient.Connection.Get>(thirdPageUrl, Arg.Is>(d => d.Count == 2 && d["direction"] == "asc" - && d["sort"] == "created"), null) + && d["sort"] == "created")) .Returns(Task.FromResult>>(lastPageResponse)); var client = new ObservablePullRequestReviewCommentsClient(gitHubClient); @@ -593,13 +593,13 @@ public async Task RequestsCorrectUrlWithoutSelectedSortingArgumentsMulti() gitHubClient.Connection.Received(1).Get>(firstPageUrl, Arg.Is>(d => d.Count == 2 && d["direction"] == "asc" - && d["sort"] == "created"), null); + && d["sort"] == "created")); gitHubClient.Connection.Received(1).Get>(secondPageUrl, Arg.Is>(d => d.Count == 2 && d["direction"] == "asc" - && d["sort"] == "created"), null); + && d["sort"] == "created")); gitHubClient.Connection.Received(1).Get>(thirdPageUrl, Arg.Is>(d => d.Count == 2 && d["direction"] == "asc" - && d["sort"] == "created"), null); + && d["sort"] == "created")); } [Fact] @@ -644,15 +644,15 @@ public async Task RequestsCorrectUrlWithoutSelectedSortingArgumentsMultiWithRepo gitHubClient.Connection.Get>(firstPageUrl, Arg.Is>(d => d.Count == 2 && d["direction"] == "asc" - && d["sort"] == "created"), null) + && d["sort"] == "created")) .Returns(Task.FromResult>>(firstPageResponse)); gitHubClient.Connection.Get>(secondPageUrl, Arg.Is>(d => d.Count == 2 && d["direction"] == "asc" - && d["sort"] == "created"), null) + && d["sort"] == "created")) .Returns(Task.FromResult>>(secondPageResponse)); gitHubClient.Connection.Get>(thirdPageUrl, Arg.Is>(d => d.Count == 2 && d["direction"] == "asc" - && d["sort"] == "created"), null) + && d["sort"] == "created")) .Returns(Task.FromResult>>(lastPageResponse)); var client = new ObservablePullRequestReviewCommentsClient(gitHubClient); @@ -663,16 +663,13 @@ public async Task RequestsCorrectUrlWithoutSelectedSortingArgumentsMultiWithRepo gitHubClient.Connection.Received(1).Get>(firstPageUrl, Arg.Is>(d => d.Count == 2 && d["direction"] == "asc" - && d["sort"] == "created"), - null); + && d["sort"] == "created")); gitHubClient.Connection.Received(1).Get>(secondPageUrl, Arg.Is>(d => d.Count == 2 && d["direction"] == "asc" - && d["sort"] == "created"), - null); + && d["sort"] == "created")); gitHubClient.Connection.Received(1).Get>(thirdPageUrl, Arg.Is>(d => d.Count == 2 && d["direction"] == "asc" - && d["sort"] == "created"), - null); + && d["sort"] == "created")); } [Fact] diff --git a/Octokit.Tests/Reactive/ObservablePullRequestReviewsClientTests.cs b/Octokit.Tests/Reactive/ObservablePullRequestReviewsClientTests.cs index 89bee2f933..4934d507a4 100644 --- a/Octokit.Tests/Reactive/ObservablePullRequestReviewsClientTests.cs +++ b/Octokit.Tests/Reactive/ObservablePullRequestReviewsClientTests.cs @@ -524,11 +524,11 @@ public async Task RequestsCorrectUrlMulti() var gitHubClient = Substitute.For(); - gitHubClient.Connection.Get>(firstPageUrl, Args.EmptyDictionary, null) + gitHubClient.Connection.Get>(firstPageUrl, Args.EmptyDictionary) .Returns(Task.FromResult>>(firstPageResponse)); - gitHubClient.Connection.Get>(secondPageUrl, Args.EmptyDictionary, null) + gitHubClient.Connection.Get>(secondPageUrl, Args.EmptyDictionary) .Returns(Task.FromResult>>(secondPageResponse)); - gitHubClient.Connection.Get>(thirdPageUrl, Args.EmptyDictionary, null) + gitHubClient.Connection.Get>(thirdPageUrl, Args.EmptyDictionary) .Returns(Task.FromResult>>(lastPageResponse)); var client = new ObservablePullRequestReviewsClient(gitHubClient); @@ -536,9 +536,9 @@ public async Task RequestsCorrectUrlMulti() var results = await client.GetAllComments("owner", "name", 7, 1).ToArray(); Assert.Equal(7, results.Length); - gitHubClient.Connection.Received(1).Get>(firstPageUrl, Args.EmptyDictionary, null); - gitHubClient.Connection.Received(1).Get>(secondPageUrl, Args.EmptyDictionary, null); - gitHubClient.Connection.Received(1).Get>(thirdPageUrl, Args.EmptyDictionary, null); + gitHubClient.Connection.Received(1).Get>(firstPageUrl, Args.EmptyDictionary); + gitHubClient.Connection.Received(1).Get>(secondPageUrl, Args.EmptyDictionary); + gitHubClient.Connection.Received(1).Get>(thirdPageUrl, Args.EmptyDictionary); } [Fact] @@ -579,11 +579,11 @@ public async Task RequestsCorrectUrlMultiWithRepositoryId() var gitHubClient = Substitute.For(); - gitHubClient.Connection.Get>(firstPageUrl, Args.EmptyDictionary, null) + gitHubClient.Connection.Get>(firstPageUrl, Args.EmptyDictionary) .Returns(Task.FromResult>>(firstPageResponse)); - gitHubClient.Connection.Get>(secondPageUrl, Args.EmptyDictionary, null) + gitHubClient.Connection.Get>(secondPageUrl, Args.EmptyDictionary) .Returns(Task.FromResult>>(secondPageResponse)); - gitHubClient.Connection.Get>(thirdPageUrl, Args.EmptyDictionary, null) + gitHubClient.Connection.Get>(thirdPageUrl, Args.EmptyDictionary) .Returns(Task.FromResult>>(lastPageResponse)); var client = new ObservablePullRequestReviewsClient(gitHubClient); @@ -591,9 +591,9 @@ public async Task RequestsCorrectUrlMultiWithRepositoryId() var results = await client.GetAllComments(1, 7, 1).ToArray(); Assert.Equal(7, results.Length); - gitHubClient.Connection.Received(1).Get>(firstPageUrl, Args.EmptyDictionary, null); - gitHubClient.Connection.Received(1).Get>(secondPageUrl, Args.EmptyDictionary, null); - gitHubClient.Connection.Received(1).Get>(thirdPageUrl, Args.EmptyDictionary, null); + gitHubClient.Connection.Received(1).Get>(firstPageUrl, Args.EmptyDictionary); + gitHubClient.Connection.Received(1).Get>(secondPageUrl, Args.EmptyDictionary); + gitHubClient.Connection.Received(1).Get>(thirdPageUrl, Args.EmptyDictionary); } [Fact] diff --git a/Octokit.Tests/Reactive/ObservablePullRequestsClientTests.cs b/Octokit.Tests/Reactive/ObservablePullRequestsClientTests.cs index dfe60b8dad..c48529d53c 100644 --- a/Octokit.Tests/Reactive/ObservablePullRequestsClientTests.cs +++ b/Octokit.Tests/Reactive/ObservablePullRequestsClientTests.cs @@ -211,11 +211,11 @@ public async Task ReturnsEveryPageOfPullRequests() } ); var gitHubClient = Substitute.For(); - gitHubClient.Connection.Get>(firstPageUrl, Args.EmptyDictionary, null) + gitHubClient.Connection.Get>(firstPageUrl, Args.EmptyDictionary) .Returns(Task.FromResult>>(firstPageResponse)); - gitHubClient.Connection.Get>(secondPageUrl, Args.EmptyDictionary, null) + gitHubClient.Connection.Get>(secondPageUrl, Args.EmptyDictionary) .Returns(Task.FromResult>>(secondPageResponse)); - gitHubClient.Connection.Get>(thirdPageUrl, Args.EmptyDictionary, null) + gitHubClient.Connection.Get>(thirdPageUrl, Args.EmptyDictionary) .Returns(Task.FromResult>>(lastPageResponse)); var client = new ObservablePullRequestsClient(gitHubClient); @@ -264,11 +264,11 @@ public async Task ReturnsEveryPageOfPullRequestsWithRepositoryId() } ); var gitHubClient = Substitute.For(); - gitHubClient.Connection.Get>(firstPageUrl, Args.EmptyDictionary, null) + gitHubClient.Connection.Get>(firstPageUrl, Args.EmptyDictionary) .Returns(Task.FromResult>>(firstPageResponse)); - gitHubClient.Connection.Get>(secondPageUrl, Args.EmptyDictionary, null) + gitHubClient.Connection.Get>(secondPageUrl, Args.EmptyDictionary) .Returns(Task.FromResult>>(secondPageResponse)); - gitHubClient.Connection.Get>(thirdPageUrl, Args.EmptyDictionary, null) + gitHubClient.Connection.Get>(thirdPageUrl, Args.EmptyDictionary) .Returns(Task.FromResult>>(lastPageResponse)); var client = new ObservablePullRequestsClient(gitHubClient); @@ -323,21 +323,21 @@ public async Task SendsAppropriateParametersMulti() && d["state"] == "open" && d["base"] == "fake_base_branch" && d["sort"] == "created" - && d["direction"] == "desc"), null) + && d["direction"] == "desc")) .Returns(Task.FromResult>>(firstPageResponse)); gitHubClient.Connection.Get>(secondPageUrl, Arg.Is>(d => d.Count == 5 && d["head"] == "user:ref-name" && d["state"] == "open" && d["base"] == "fake_base_branch" && d["sort"] == "created" - && d["direction"] == "desc"), null) + && d["direction"] == "desc")) .Returns(Task.FromResult>>(secondPageResponse)); gitHubClient.Connection.Get>(thirdPageUrl, Arg.Is>(d => d.Count == 5 && d["head"] == "user:ref-name" && d["state"] == "open" && d["base"] == "fake_base_branch" && d["sort"] == "created" - && d["direction"] == "desc"), null) + && d["direction"] == "desc")) .Returns(Task.FromResult>>(lastPageResponse)); var client = new ObservablePullRequestsClient(gitHubClient); @@ -392,21 +392,21 @@ public async Task SendsAppropriateParametersMultiWithRepositoryId() && d["state"] == "open" && d["base"] == "fake_base_branch" && d["sort"] == "created" - && d["direction"] == "desc"), null) + && d["direction"] == "desc")) .Returns(Task.FromResult>>(firstPageResponse)); gitHubClient.Connection.Get>(secondPageUrl, Arg.Is>(d => d.Count == 5 && d["head"] == "user:ref-name" && d["state"] == "open" && d["base"] == "fake_base_branch" && d["sort"] == "created" - && d["direction"] == "desc"), null) + && d["direction"] == "desc")) .Returns(Task.FromResult>>(secondPageResponse)); gitHubClient.Connection.Get>(thirdPageUrl, Arg.Is>(d => d.Count == 5 && d["head"] == "user:ref-name" && d["state"] == "open" && d["base"] == "fake_base_branch" && d["sort"] == "created" - && d["direction"] == "desc"), null) + && d["direction"] == "desc")) .Returns(Task.FromResult>>(lastPageResponse)); var client = new ObservablePullRequestsClient(gitHubClient); @@ -640,7 +640,7 @@ public async Task FetchesAllCommitsForPullRequest() CreateResponse(HttpStatusCode.OK), new List { commit } ); - connection.Get>(Args.Uri, null, null) + connection.Get>(Args.Uri, null) .Returns(Task.FromResult(response)); gitHubClient.Connection.Returns(connection); var client = new ObservablePullRequestsClient(gitHubClient); @@ -649,7 +649,7 @@ public async Task FetchesAllCommitsForPullRequest() Assert.Equal(1, commits.Count); Assert.Same(commit, commits[0]); - connection.Received().Get>(new Uri(expectedUrl, UriKind.Relative), null, null); + connection.Received().Get>(new Uri(expectedUrl, UriKind.Relative), null); } [Fact] @@ -664,7 +664,7 @@ public async Task FetchesAllCommitsForPullRequestWithRepositoryId() CreateResponse(HttpStatusCode.OK), new List { commit } ); - connection.Get>(Args.Uri, null, null) + connection.Get>(Args.Uri, null) .Returns(Task.FromResult(response)); gitHubClient.Connection.Returns(connection); var client = new ObservablePullRequestsClient(gitHubClient); @@ -673,7 +673,7 @@ public async Task FetchesAllCommitsForPullRequestWithRepositoryId() Assert.Equal(1, commits.Count); Assert.Same(commit, commits[0]); - connection.Received().Get>(new Uri(expectedUrl, UriKind.Relative), null, null); + connection.Received().Get>(new Uri(expectedUrl, UriKind.Relative), null); } [Fact] @@ -704,7 +704,7 @@ public async Task FetchesAllFilesForPullRequest() CreateResponse(HttpStatusCode.OK), new List { file } ); - connection.Get>(Args.Uri, null, null) + connection.Get>(Args.Uri, null) .Returns(Task.FromResult(response)); gitHubClient.Connection.Returns(connection); var client = new ObservablePullRequestsClient(gitHubClient); @@ -713,7 +713,7 @@ public async Task FetchesAllFilesForPullRequest() Assert.Equal(1, files.Count); Assert.Same(file, files[0]); - connection.Received().Get>(new Uri(expectedUrl, UriKind.Relative), null, null); + connection.Received().Get>(new Uri(expectedUrl, UriKind.Relative), null); } [Fact] @@ -728,7 +728,7 @@ public async Task FetchesAllFilesForPullRequestWithRepositoryId() CreateResponse(HttpStatusCode.OK), new List { file } ); - connection.Get>(Args.Uri, null, null) + connection.Get>(Args.Uri, null) .Returns(Task.FromResult(response)); gitHubClient.Connection.Returns(connection); var client = new ObservablePullRequestsClient(gitHubClient); @@ -737,7 +737,7 @@ public async Task FetchesAllFilesForPullRequestWithRepositoryId() Assert.Equal(1, files.Count); Assert.Same(file, files[0]); - connection.Received().Get>(new Uri(expectedUrl, UriKind.Relative), null, null); + connection.Received().Get>(new Uri(expectedUrl, UriKind.Relative), null); } [Fact] diff --git a/Octokit.Tests/Reactive/ObservableReleasesClientTests.cs b/Octokit.Tests/Reactive/ObservableReleasesClientTests.cs index 438bd1fe91..71771feb90 100644 --- a/Octokit.Tests/Reactive/ObservableReleasesClientTests.cs +++ b/Octokit.Tests/Reactive/ObservableReleasesClientTests.cs @@ -29,7 +29,7 @@ public void RequestsTheCorrectUrl() client.GetAll("fake", "repo"); gitHubClient.Connection.Received(1).Get>( - new Uri("repos/fake/repo/releases", UriKind.Relative), Args.EmptyDictionary, null); + new Uri("repos/fake/repo/releases", UriKind.Relative), Args.EmptyDictionary); } [Fact] @@ -41,7 +41,7 @@ public void RequestsTheCorrectUrlWithRepositoryId() client.GetAll(1); gitHubClient.Connection.Received(1).Get>( - new Uri("repositories/1/releases", UriKind.Relative), Args.EmptyDictionary, null); + new Uri("repositories/1/releases", UriKind.Relative), Args.EmptyDictionary); } [Fact] @@ -60,7 +60,7 @@ public void RequestsTheCorrectUrlWithApiOptions() client.GetAll("fake", "repo", options); gitHubClient.Connection.Received(1).Get>( - new Uri("repos/fake/repo/releases", UriKind.Relative), Arg.Is>(d => d.Count == 2), null); + new Uri("repos/fake/repo/releases", UriKind.Relative), Arg.Is>(d => d.Count == 2)); } [Fact] @@ -79,7 +79,7 @@ public void RequestsTheCorrectUrlWithRepositoryIdWithApiOptions() client.GetAll(1, options); gitHubClient.Connection.Received(1).Get>( - new Uri("repositories/1/releases", UriKind.Relative), Arg.Is>(d => d.Count == 2), null); + new Uri("repositories/1/releases", UriKind.Relative), Arg.Is>(d => d.Count == 2)); } [Fact] @@ -342,7 +342,7 @@ public void RequestsTheCorrectUrl() client.GetAllAssets("fake", "repo", 1); gitHubClient.Connection.Received(1).Get>( - new Uri("repos/fake/repo/releases/1/assets", UriKind.Relative), Args.EmptyDictionary, null); + new Uri("repos/fake/repo/releases/1/assets", UriKind.Relative), Args.EmptyDictionary); } [Fact] @@ -354,7 +354,7 @@ public void RequestsTheCorrectUrlWithRepositoryId() client.GetAllAssets(1, 1); gitHubClient.Connection.Received(1).Get>( - new Uri("repositories/1/releases/1/assets", UriKind.Relative), Args.EmptyDictionary, null); + new Uri("repositories/1/releases/1/assets", UriKind.Relative), Args.EmptyDictionary); } [Fact] @@ -376,8 +376,7 @@ public void RequestsTheCorrectUrlWithApiOptions() gitHubClient.Connection.Received(1).Get>( Arg.Is(u => u.ToString() == expectedUrl), - Arg.Is>(dictionary => dictionary.Count == 2), - null); + Arg.Is>(dictionary => dictionary.Count == 2)); } [Fact] @@ -399,8 +398,7 @@ public void RequestsTheCorrectUrlWithRepositoryIdWithApiOptions() gitHubClient.Connection.Received(1).Get>( Arg.Is(u => u.ToString() == expectedUrl), - Arg.Is>(dictionary => dictionary.Count == 2), - null); + Arg.Is>(dictionary => dictionary.Count == 2)); } [Fact] diff --git a/Octokit.Tests/Reactive/ObservableRepoCollaboratorsClientTests.cs b/Octokit.Tests/Reactive/ObservableRepoCollaboratorsClientTests.cs index 8b0b78f853..d48a007a96 100644 --- a/Octokit.Tests/Reactive/ObservableRepoCollaboratorsClientTests.cs +++ b/Octokit.Tests/Reactive/ObservableRepoCollaboratorsClientTests.cs @@ -69,8 +69,7 @@ public void RequestsCorrectUrl() _client.GetAll(owner, name); _githubClient.Connection.Received(1) .Get>(Arg.Is(u => u.ToString() == expectedUrl), - Arg.Is>(dictionary => dictionary.Count == 1), - null); + Arg.Is>(dictionary => dictionary.Count == 1)); } [Fact] @@ -81,8 +80,7 @@ public void RequestsCorrectUrlWithRepositoryId() _client.GetAll(repositoryId); _githubClient.Connection.Received(1) .Get>(Arg.Is(u => u.ToString() == expectedUrl), - Arg.Is>(dictionary => dictionary.Count == 1), - null); + Arg.Is>(dictionary => dictionary.Count == 1)); } [Fact] @@ -101,8 +99,7 @@ public void RequestsCorrectUrlWithApiOptions() _client.GetAll(owner, name, options); _githubClient.Connection.Received(1) .Get>(Arg.Is(u => u.ToString() == expectedUrl), - Arg.Is>(dictionary => dictionary.Count == 3), - null); + Arg.Is>(dictionary => dictionary.Count == 3)); // StartPage is setted => only 1 option (StartPage) in dictionary options = new ApiOptions @@ -113,8 +110,7 @@ public void RequestsCorrectUrlWithApiOptions() _client.GetAll(owner, name, options); _githubClient.Connection.Received(1) .Get>(Arg.Is(u => u.ToString() == expectedUrl), - Arg.Is>(dictionary => dictionary.Count == 2), - null); + Arg.Is>(dictionary => dictionary.Count == 2)); // PageCount is setted => none of options in dictionary options = new ApiOptions @@ -125,8 +121,7 @@ public void RequestsCorrectUrlWithApiOptions() _client.GetAll(owner, name, options); _githubClient.Connection.Received(1) .Get>(Arg.Is(u => u.ToString() == expectedUrl), - Arg.Is>(dictionary => dictionary.Count == 1), - null); + Arg.Is>(dictionary => dictionary.Count == 1)); } [Fact] @@ -139,8 +134,7 @@ public void RequestsCorrectUrlWithCollaboratorFilter() _client.GetAll(owner, name, request); _githubClient.Connection.Received(1) .Get>(Arg.Is(u => u.ToString() == expectedUrl), - Arg.Is>(d => d["affiliation"] == "all"), - null); + Arg.Is>(d => d["affiliation"] == "all")); request = new RepositoryCollaboratorListRequest { @@ -150,8 +144,7 @@ public void RequestsCorrectUrlWithCollaboratorFilter() _client.GetAll(owner, name, request); _githubClient.Connection.Received(1) .Get>(Arg.Is(u => u.ToString() == expectedUrl), - Arg.Is>(d => d["affiliation"] == "direct"), - null); + Arg.Is>(d => d["affiliation"] == "direct")); // PageCount is setted => none of options in dictionary request = new RepositoryCollaboratorListRequest @@ -162,8 +155,7 @@ public void RequestsCorrectUrlWithCollaboratorFilter() _client.GetAll(owner, name, request); _githubClient.Connection.Received(1) .Get>(Arg.Is(u => u.ToString() == expectedUrl), - Arg.Is>(d => d["affiliation"] == "outside"), - null); + Arg.Is>(d => d["affiliation"] == "outside")); } [Fact] @@ -182,8 +174,7 @@ public void RequestsCorrectUrlWithApiOptionsAndRepositoryId() _client.GetAll(repositoryId, options); _githubClient.Connection.Received(1) .Get>(Arg.Is(u => u.ToString() == expectedUrl), - Arg.Is>(dictionary => dictionary.Count == 3), - null); + Arg.Is>(dictionary => dictionary.Count == 3)); // StartPage is setted => only 1 option (StartPage) in dictionary options = new ApiOptions @@ -194,8 +185,7 @@ public void RequestsCorrectUrlWithApiOptionsAndRepositoryId() _client.GetAll(repositoryId, options); _githubClient.Connection.Received(1) .Get>(Arg.Is(u => u.ToString() == expectedUrl), - Arg.Is>(dictionary => dictionary.Count == 2), - null); + Arg.Is>(dictionary => dictionary.Count == 2)); // PageCount is setted => none of options in dictionary options = new ApiOptions @@ -206,8 +196,7 @@ public void RequestsCorrectUrlWithApiOptionsAndRepositoryId() _client.GetAll(repositoryId, options); _githubClient.Connection.Received(1) .Get>(Arg.Is(u => u.ToString() == expectedUrl), - Arg.Is>(dictionary => dictionary.Count == 1), - null); + Arg.Is>(dictionary => dictionary.Count == 1)); } [Fact] @@ -220,8 +209,7 @@ public void RequestsCorrectUrlWithCollaboratorFilterAndRepositoryId() _client.GetAll(repositoryId, request); _githubClient.Connection.Received(1) .Get>(Arg.Is(u => u.ToString() == expectedUrl), - Arg.Is>(d => d["affiliation"] == "all"), - null); + Arg.Is>(d => d["affiliation"] == "all")); request = new RepositoryCollaboratorListRequest { @@ -231,8 +219,7 @@ public void RequestsCorrectUrlWithCollaboratorFilterAndRepositoryId() _client.GetAll(repositoryId, request); _githubClient.Connection.Received(1) .Get>(Arg.Is(u => u.ToString() == expectedUrl), - Arg.Is>(d => d["affiliation"] == "direct"), - null); + Arg.Is>(d => d["affiliation"] == "direct")); request = new RepositoryCollaboratorListRequest { @@ -242,8 +229,7 @@ public void RequestsCorrectUrlWithCollaboratorFilterAndRepositoryId() _client.GetAll(repositoryId, request); _githubClient.Connection.Received(1) .Get>(Arg.Is(u => u.ToString() == expectedUrl), - Arg.Is>(d => d["affiliation"] == "outside"), - null); + Arg.Is>(d => d["affiliation"] == "outside")); } } diff --git a/Octokit.Tests/Reactive/ObservableRepositoriesClientTests.cs b/Octokit.Tests/Reactive/ObservableRepositoriesClientTests.cs index 8bac0894d9..747fd1d4fb 100644 --- a/Octokit.Tests/Reactive/ObservableRepositoriesClientTests.cs +++ b/Octokit.Tests/Reactive/ObservableRepositoriesClientTests.cs @@ -273,20 +273,20 @@ public async Task ReturnsEveryPageOfRepositories() }); var gitHubClient = Substitute.For(); - gitHubClient.Connection.Get>(firstPageUrl, Arg.Any>(), Args.AnyAcceptHeaders) + gitHubClient.Connection.Get>(firstPageUrl, Arg.Any>()) .Returns(Task.FromResult>>(firstPageResponse)); - gitHubClient.Connection.Get>(secondPageUrl, Arg.Any>(), Args.AnyAcceptHeaders) + gitHubClient.Connection.Get>(secondPageUrl, Arg.Any>()) .Returns(Task.FromResult>>(secondPageResponse)); - gitHubClient.Connection.Get>(thirdPageUrl, Arg.Any>(), Args.AnyAcceptHeaders) + gitHubClient.Connection.Get>(thirdPageUrl, Arg.Any>()) .Returns(Task.FromResult>>(lastPageResponse)); var repositoriesClient = new ObservableRepositoriesClient(gitHubClient); var results = await repositoriesClient.GetAllForCurrent().ToArray(); Assert.Equal(7, results.Length); - gitHubClient.Connection.Received(1).Get>(firstPageUrl, Arg.Any>(), Args.AnyAcceptHeaders); - gitHubClient.Connection.Received(1).Get>(secondPageUrl, Arg.Any>(), Args.AnyAcceptHeaders); - gitHubClient.Connection.Received(1).Get>(thirdPageUrl, Arg.Any>(), Args.AnyAcceptHeaders); + gitHubClient.Connection.Received(1).Get>(firstPageUrl, Arg.Any>()); + gitHubClient.Connection.Received(1).Get>(secondPageUrl, Arg.Any>()); + gitHubClient.Connection.Received(1).Get>(thirdPageUrl, Arg.Any>()); } [Fact(Skip = "See https://github.com/octokit/octokit.net/issues/1011 for issue to investigate this further")] @@ -393,11 +393,11 @@ public async Task ReturnsEveryPageOfRepositories() }); var gitHubClient = Substitute.For(); - gitHubClient.Connection.Get>(firstPageUrl, null, Args.AnyAcceptHeaders) + gitHubClient.Connection.Get>(firstPageUrl, null) .Returns(Task.FromResult(firstPageResponse)); - gitHubClient.Connection.Get>(secondPageUrl, null, Args.AnyAcceptHeaders) + gitHubClient.Connection.Get>(secondPageUrl, null) .Returns(Task.FromResult(secondPageResponse)); - gitHubClient.Connection.Get>(thirdPageUrl, null, Args.AnyAcceptHeaders) + gitHubClient.Connection.Get>(thirdPageUrl, null) .Returns(Task.FromResult(lastPageResponse)); var repositoriesClient = new ObservableRepositoriesClient(gitHubClient); @@ -405,9 +405,9 @@ public async Task ReturnsEveryPageOfRepositories() var results = await repositoriesClient.GetAllPublic(new PublicRepositoryRequest(364L)).ToArray(); Assert.Equal(7, results.Length); - gitHubClient.Connection.Received(1).Get>(firstPageUrl, Arg.Any>(), Args.AnyAcceptHeaders); - gitHubClient.Connection.Received(1).Get>(secondPageUrl, Arg.Any>(), Args.AnyAcceptHeaders); - gitHubClient.Connection.Received(1).Get>(thirdPageUrl, Arg.Any>(), Args.AnyAcceptHeaders); + gitHubClient.Connection.Received(1).Get>(firstPageUrl, Arg.Any>()); + gitHubClient.Connection.Received(1).Get>(secondPageUrl, Arg.Any>()); + gitHubClient.Connection.Received(1).Get>(thirdPageUrl, Arg.Any>()); } } @@ -461,7 +461,7 @@ public void RequestsTheCorrectUrl() client.Commit.GetAll("owner", "repo"); - github.Connection.Received(1).Get>(expected, Arg.Any>(), null); + github.Connection.Received(1).Get>(expected, Arg.Any>()); } } @@ -478,8 +478,7 @@ public void RequestsTheCorrectUrl() gitHubClient.Connection.Received(1) .Get>(expected, - Args.EmptyDictionary, - null); + Args.EmptyDictionary); } [Fact] @@ -493,8 +492,7 @@ public void RequestsTheCorrectUrlWithRepositoryId() gitHubClient.Connection.Received(1) .Get>(expected, - Args.EmptyDictionary, - null); + Args.EmptyDictionary); } [Fact] @@ -515,8 +513,7 @@ public void RequestsTheCorrectUrlWithApiOptions() gitHubClient.Connection.Received(1) .Get>(expected, - Arg.Is>(d => d.Count == 2 && d["page"] == "1" && d["per_page"] == "1"), - null); + Arg.Is>(d => d.Count == 2 && d["page"] == "1" && d["per_page"] == "1")); } [Fact] @@ -537,8 +534,7 @@ public void RequestsTheCorrectUrlWithApiOptionsWithRepositoryId() gitHubClient.Connection.Received(1) .Get>(expected, - Arg.Is>(d => d.Count == 2), - null); + Arg.Is>(d => d.Count == 2)); } [Fact] @@ -550,7 +546,7 @@ public void RequestsTheCorrectUrlIncludeAnonymous() client.GetAllContributors("owner", "name", true); gitHubClient.Connection.Received() - .Get>(Arg.Is(u => u.ToString() == "repos/owner/name/contributors"), Arg.Is>(d => d["anon"] == "1"), null); + .Get>(Arg.Is(u => u.ToString() == "repos/owner/name/contributors"), Arg.Is>(d => d["anon"] == "1")); } [Fact] @@ -562,7 +558,7 @@ public void RequestsTheCorrectUrlWithRepositoryIdIncludeAnonymous() client.GetAllContributors(1, true); gitHubClient.Connection.Received() - .Get>(Arg.Is(u => u.ToString() == "repositories/1/contributors"), Arg.Is>(d => d["anon"] == "1"), null); + .Get>(Arg.Is(u => u.ToString() == "repositories/1/contributors"), Arg.Is>(d => d["anon"] == "1")); } [Fact] @@ -581,7 +577,8 @@ public void RequestsTheCorrectUrlWithApiOptionsIncludeAnonymous() client.GetAllContributors("owner", "name", true, options); gitHubClient.Connection.Received() - .Get>(Arg.Is(u => u.ToString() == "repos/owner/name/contributors"), Arg.Is>(d => d.Count == 3 && d["anon"] == "1" && d["page"] == "1" && d["per_page"] == "1"), null); + .Get>(Arg.Is(u => u.ToString() == "repos/owner/name/contributors"), + Arg.Is>(d => d.Count == 3 && d["anon"] == "1" && d["page"] == "1" && d["per_page"] == "1")); } [Fact] @@ -600,7 +597,8 @@ public void RequestsTheCorrectUrlWithRepositoryIdWithApiOptionsIncludeAnonymous( client.GetAllContributors(1, true, options); gitHubClient.Connection.Received() - .Get>(Arg.Is(u => u.ToString() == "repositories/1/contributors"), Arg.Is>(d => d.Count == 3 && d["anon"] == "1" && d["page"] == "1" && d["per_page"] == "1"), null); + .Get>(Arg.Is(u => u.ToString() == "repositories/1/contributors"), + Arg.Is>(d => d.Count == 3 && d["anon"] == "1" && d["page"] == "1" && d["per_page"] == "1")); } [Fact] @@ -680,8 +678,7 @@ public void RequestsTheCorrectUrl() client.GetAllTeams("owner", "repo"); gitHubClient.Connection.Received(1).Get>(expected, - Arg.Any>(), - Arg.Any()); + Arg.Any>()); } [Fact] @@ -694,8 +691,7 @@ public void RequestsTheCorrectUrlWithRepositoryId() client.GetAllTeams(1); gitHubClient.Connection.Received(1).Get>(expected, - Arg.Any>(), - Arg.Any()); + Arg.Any>()); } [Fact] @@ -715,8 +711,7 @@ public void RequestsTheCorrectUrlWithApiOptions() client.GetAllTeams("owner", "repo", options); gitHubClient.Connection.Received(1).Get>(expected, - Arg.Is>(d => d.Count == 2 && d["page"] == "1" && d["per_page"] == "1"), - Arg.Any()); + Arg.Is>(d => d.Count == 2 && d["page"] == "1" && d["per_page"] == "1")); } [Fact] @@ -736,8 +731,7 @@ public void RequestsTheCorrectUrlWithRepositoryIdWithApiOptions() client.GetAllTeams(1, options); gitHubClient.Connection.Received(1).Get>(expected, - Arg.Is>(d => d.Count == 2 && d["page"] == "1" && d["per_page"] == "1"), - Arg.Any()); + Arg.Is>(d => d.Count == 2 && d["page"] == "1" && d["per_page"] == "1")); } [Fact] @@ -771,7 +765,8 @@ public void RequestsTheCorrectUrl() client.GetAllTags("owner", "repo"); - gitHubClient.Connection.Received(1).Get>(expected, Arg.Any>(), null); + var received = gitHubClient.Connection.ReceivedCalls(); + gitHubClient.Connection.Received(1).Get>(expected, Arg.Any>()); } [Fact] @@ -783,7 +778,7 @@ public void RequestsTheCorrectUrlWithRepositoryId() client.GetAllTags(1); - gitHubClient.Connection.Received(1).Get>(expected, Arg.Any>(), null); + gitHubClient.Connection.Received(1).Get>(expected, Arg.Any>()); } [Fact] @@ -802,7 +797,7 @@ public void RequestsTheCorrectUrlWithApiOptions() client.GetAllTags("owner", "repo", options); - gitHubClient.Connection.Received(1).Get>(expected, Arg.Is>(d => d.Count == 2 && d["page"] == "1" && d["per_page"] == "1"), null); + gitHubClient.Connection.Received(1).Get>(expected, Arg.Is>(d => d.Count == 2 && d["page"] == "1" && d["per_page"] == "1")); } [Fact] @@ -821,7 +816,7 @@ public void RequestsTheCorrectUrlWithRepositoryIdWithApiOptions() client.GetAllTags(1, options); - gitHubClient.Connection.Received(1).Get>(expected, Arg.Is>(d => d.Count == 2 && d["page"] == "1" && d["per_page"] == "1"), null); + gitHubClient.Connection.Received(1).Get>(expected, Arg.Is>(d => d.Count == 2 && d["page"] == "1" && d["per_page"] == "1")); } [Fact] diff --git a/Octokit.Tests/Reactive/ObservableRepositoryBranchesClientTests.cs b/Octokit.Tests/Reactive/ObservableRepositoryBranchesClientTests.cs index 0001c8c425..2135f10f5c 100644 --- a/Octokit.Tests/Reactive/ObservableRepositoryBranchesClientTests.cs +++ b/Octokit.Tests/Reactive/ObservableRepositoryBranchesClientTests.cs @@ -32,7 +32,7 @@ public void RequestsTheCorrectUrl() client.GetAll("owner", "repo"); - gitHubClient.Connection.Received(1).Get>(expected, Args.EmptyDictionary, null); + gitHubClient.Connection.Received(1).Get>(expected, Args.EmptyDictionary); } [Fact] @@ -44,7 +44,7 @@ public void RequestsTheCorrectUrlWithRepositoryId() client.GetAll(1); - gitHubClient.Connection.Received(1).Get>(expected, Args.EmptyDictionary, null); + gitHubClient.Connection.Received(1).Get>(expected, Args.EmptyDictionary); } [Fact] @@ -63,7 +63,7 @@ public void RequestsTheCorrectUrlWithApiOptions() client.GetAll("owner", "name", options); - gitHubClient.Connection.Received(1).Get>(expected, Arg.Is>(d => d.Count == 2 && d["page"] == "1" && d["per_page"] == "1"), null); + gitHubClient.Connection.Received(1).Get>(expected, Arg.Is>(d => d.Count == 2 && d["page"] == "1" && d["per_page"] == "1")); } [Fact] @@ -82,7 +82,7 @@ public void RequestsTheCorrectUrlWithRepositoryIdWithApiOptions() client.GetAll(1, options); - gitHubClient.Connection.Received(1).Get>(expected, Arg.Is>(d => d.Count == 2 && d["page"] == "1" && d["per_page"] == "1"), null); + gitHubClient.Connection.Received(1).Get>(expected, Arg.Is>(d => d.Count == 2 && d["page"] == "1" && d["per_page"] == "1")); } [Fact] diff --git a/Octokit.Tests/Reactive/ObservableRepositoryCommentsClientTests.cs b/Octokit.Tests/Reactive/ObservableRepositoryCommentsClientTests.cs index a78c59af9a..8c12a48a0f 100644 --- a/Octokit.Tests/Reactive/ObservableRepositoryCommentsClientTests.cs +++ b/Octokit.Tests/Reactive/ObservableRepositoryCommentsClientTests.cs @@ -66,7 +66,7 @@ public void RequestsCorrectUrl() client.GetAllForRepository("fake", "repo"); githubClient.Connection.Received(1).Get>(Arg.Is(uri => uri.ToString() == "repos/fake/repo/comments"), - Args.EmptyDictionary, null); + Args.EmptyDictionary); } [Fact] @@ -77,7 +77,7 @@ public void RequestsCorrectUrlWithRepositoryId() client.GetAllForRepository(1); githubClient.Connection.Received(1).Get>(Arg.Is(uri => uri.ToString() == "repositories/1/comments"), - Args.EmptyDictionary, null); + Args.EmptyDictionary); } [Fact] @@ -95,7 +95,7 @@ public void RequestsCorrectUrlWithApiOptions() client.GetAllForRepository("fake", "repo", options); githubClient.Connection.Received(1).Get>(Arg.Is(uri => uri.ToString() == "repos/fake/repo/comments"), - Arg.Is>(dictionary => dictionary.Count == 2), null); + Arg.Is>(dictionary => dictionary.Count == 2)); } [Fact] @@ -113,7 +113,7 @@ public void RequestsCorrectUrlWithRepositoryIdWithApiOptions() client.GetAllForRepository(1, options); githubClient.Connection.Received(1).Get>(Arg.Is(uri => uri.ToString() == "repositories/1/comments"), - Arg.Is>(dictionary => dictionary.Count == 2), null); + Arg.Is>(dictionary => dictionary.Count == 2)); } [Fact] @@ -147,7 +147,7 @@ public void RequestsCorrectUrl() client.GetAllForCommit("fake", "repo", "sha"); githubClient.Connection.Received().Get>(Arg.Is(new Uri("repos/fake/repo/commits/sha/comments", UriKind.Relative)), - Args.EmptyDictionary, null); + Args.EmptyDictionary); } [Fact] @@ -158,7 +158,7 @@ public void RequestsCorrectUrlWithRepositoryId() client.GetAllForCommit(1, "sha"); githubClient.Connection.Received().Get>(Arg.Is(new Uri("repositories/1/commits/sha/comments", UriKind.Relative)), - Args.EmptyDictionary, null); + Args.EmptyDictionary); } [Fact] @@ -176,7 +176,7 @@ public void RequestsCorrectUrlWithApiOptions() client.GetAllForCommit("fake", "repo", "sha", options); githubClient.Connection.Received().Get>(Arg.Is(new Uri("repos/fake/repo/commits/sha/comments", UriKind.Relative)), - Arg.Is>(d => d.Count == 2), null); + Arg.Is>(d => d.Count == 2)); } [Fact] @@ -194,7 +194,7 @@ public void RequestsCorrectUrlWithRepositoryIdWithApiOptions() client.GetAllForCommit(1, "sha", options); githubClient.Connection.Received().Get>(Arg.Is(new Uri("repositories/1/commits/sha/comments", UriKind.Relative)), - Arg.Is>(d => d.Count == 2), null); + Arg.Is>(d => d.Count == 2)); } [Fact] diff --git a/Octokit.Tests/Reactive/ObservableRepositoryContentsClientTests.cs b/Octokit.Tests/Reactive/ObservableRepositoryContentsClientTests.cs index 400387ebf1..4339adc41e 100644 --- a/Octokit.Tests/Reactive/ObservableRepositoryContentsClientTests.cs +++ b/Octokit.Tests/Reactive/ObservableRepositoryContentsClientTests.cs @@ -173,12 +173,12 @@ public async Task ReturnsContents() var contentsClient = new ObservableRepositoryContentsClient(gitHubClient); IApiResponse> response = new ApiResponse>(CreateResponse(HttpStatusCode.OK), result); - connection.Get>(Args.Uri, null, null) + connection.Get>(Args.Uri, null) .Returns(Task.FromResult(response)); var contents = await contentsClient.GetAllContents("fake", "repo").ToList(); - connection.Received().Get>(Arg.Is(u => u.ToString() == "repos/fake/repo/contents/"), null, null); + connection.Received().Get>(Arg.Is(u => u.ToString() == "repos/fake/repo/contents/"), null); Assert.Equal(1, contents.Count); } @@ -192,12 +192,12 @@ public async Task ReturnsContentsWithRepositoryId() var contentsClient = new ObservableRepositoryContentsClient(gitHubClient); IApiResponse> response = new ApiResponse>(CreateResponse(HttpStatusCode.OK), result); - connection.Get>(Args.Uri, null, null) + connection.Get>(Args.Uri, null) .Returns(Task.FromResult(response)); var contents = await contentsClient.GetAllContents(1).ToList(); - connection.Received().Get>(Arg.Is(u => u.ToString() == "repositories/1/contents/"), null, null); + connection.Received().Get>(Arg.Is(u => u.ToString() == "repositories/1/contents/"), null); Assert.Equal(1, contents.Count); } @@ -211,12 +211,12 @@ public async Task ReturnsAllContents() var contentsClient = new ObservableRepositoryContentsClient(gitHubClient); IApiResponse> response = new ApiResponse>(CreateResponse(HttpStatusCode.OK), result); - connection.Get>(Args.Uri, null, null) + connection.Get>(Args.Uri, null) .Returns(Task.FromResult(response)); var contents = await contentsClient.GetAllContents("fake", "repo").ToList(); - connection.Received().Get>(Arg.Is(u => u.ToString() == "repos/fake/repo/contents/"), null, null); + connection.Received().Get>(Arg.Is(u => u.ToString() == "repos/fake/repo/contents/"), null); Assert.Equal(1, contents.Count); } @@ -229,12 +229,12 @@ public async Task ReturnsAllContentsWithRepositoryId() var gitHubClient = new GitHubClient(connection); var contentsClient = new ObservableRepositoryContentsClient(gitHubClient); IApiResponse> response = new ApiResponse>(CreateResponse(HttpStatusCode.OK), result); - connection.Get>(Args.Uri, null, null) + connection.Get>(Args.Uri, null) .Returns(Task.FromResult(response)); var contents = await contentsClient.GetAllContents(1).ToList(); - connection.Received().Get>(Arg.Is(u => u.ToString() == "repositories/1/contents/"), null, null); + connection.Received().Get>(Arg.Is(u => u.ToString() == "repositories/1/contents/"), null); Assert.Equal(1, contents.Count); } @@ -309,12 +309,12 @@ public async Task ReturnsContentsByRef() var contentsClient = new ObservableRepositoryContentsClient(gitHubClient); IApiResponse> response = new ApiResponse>(CreateResponse(HttpStatusCode.OK), result); - connection.Get>(Args.Uri, null, null) + connection.Get>(Args.Uri, null) .Returns(Task.FromResult(response)); var contents = await contentsClient.GetAllContentsByRef("fake", "repo", GitHubConstants.DefaultBranchName, "readme.md").ToList(); - connection.Received().Get>(Arg.Is(u => u.ToString() == $"repos/fake/repo/contents/readme.md?ref={GitHubConstants.DefaultBranchName}"), null, null); + connection.Received().Get>(Arg.Is(u => u.ToString() == $"repos/fake/repo/contents/readme.md?ref={GitHubConstants.DefaultBranchName}"), null); Assert.Equal(1, contents.Count); } @@ -327,12 +327,12 @@ public async Task ReturnsContentsByRefWithRepositoryId() var gitHubClient = new GitHubClient(connection); var contentsClient = new ObservableRepositoryContentsClient(gitHubClient); IApiResponse> response = new ApiResponse>(CreateResponse(HttpStatusCode.OK), result); - connection.Get>(Args.Uri, null, null) + connection.Get>(Args.Uri, null) .Returns(Task.FromResult(response)); var contents = await contentsClient.GetAllContentsByRef(1, GitHubConstants.DefaultBranchName, "readme.md").ToList(); - connection.Received().Get>(Arg.Is(u => u.ToString() == $"repositories/1/contents/readme.md?ref={GitHubConstants.DefaultBranchName}"), null, null); + connection.Received().Get>(Arg.Is(u => u.ToString() == $"repositories/1/contents/readme.md?ref={GitHubConstants.DefaultBranchName}"), null); Assert.Equal(1, contents.Count); } @@ -345,12 +345,12 @@ public async Task ReturnsAllContentsByRef() var gitHubClient = new GitHubClient(connection); var contentsClient = new ObservableRepositoryContentsClient(gitHubClient); IApiResponse> response = new ApiResponse>(CreateResponse(HttpStatusCode.OK), result); - connection.Get>(Args.Uri, null, null) + connection.Get>(Args.Uri, null) .Returns(Task.FromResult(response)); var contents = await contentsClient.GetAllContentsByRef("fake", "repo", GitHubConstants.DefaultBranchName).ToList(); - connection.Received().Get>(Arg.Is(u => u.ToString() == $"repos/fake/repo/contents/?ref={GitHubConstants.DefaultBranchName}"), null, null); + connection.Received().Get>(Arg.Is(u => u.ToString() == $"repos/fake/repo/contents/?ref={GitHubConstants.DefaultBranchName}"), null); Assert.Equal(1, contents.Count); } @@ -363,12 +363,12 @@ public async Task ReturnsAllContentsByRefWithRepositoryId() var gitHubClient = new GitHubClient(connection); var contentsClient = new ObservableRepositoryContentsClient(gitHubClient); IApiResponse> response = new ApiResponse>(CreateResponse(HttpStatusCode.OK), result); - connection.Get>(Args.Uri, null, null) + connection.Get>(Args.Uri, null) .Returns(Task.FromResult(response)); var contents = await contentsClient.GetAllContentsByRef(1, GitHubConstants.DefaultBranchName).ToList(); - connection.Received().Get>(Arg.Is(u => u.ToString() == $"repositories/1/contents/?ref={GitHubConstants.DefaultBranchName}"), null, null); + connection.Received().Get>(Arg.Is(u => u.ToString() == $"repositories/1/contents/?ref={GitHubConstants.DefaultBranchName}"), null); Assert.Equal(1, contents.Count); } diff --git a/Octokit.Tests/Reactive/ObservableRepositoryDeployKeysClientTests.cs b/Octokit.Tests/Reactive/ObservableRepositoryDeployKeysClientTests.cs index f0d553fe7a..c185cd9dd0 100644 --- a/Octokit.Tests/Reactive/ObservableRepositoryDeployKeysClientTests.cs +++ b/Octokit.Tests/Reactive/ObservableRepositoryDeployKeysClientTests.cs @@ -65,7 +65,7 @@ public void RequestsCorrectUrl() deployKeysClient.GetAll("user", "repo"); gitHubClient.Connection.Received(1).Get>( - new Uri("repos/user/repo/keys", UriKind.Relative), Arg.Is>(dictionary => dictionary.Count == 0), null); + new Uri("repos/user/repo/keys", UriKind.Relative), Arg.Is>(dictionary => dictionary.Count == 0)); } [Fact] @@ -86,8 +86,7 @@ public void RequestsCorrectUrlWithApiOptions() deployKeysClient.GetAll("user", "repo", options); gitHubClient.Connection.Received(1) .Get>(Arg.Is(u => u.ToString() == expectedUrl), - Arg.Is>(dictionary => dictionary.Count == 2), - null); + Arg.Is>(dictionary => dictionary.Count == 2)); // StartPage is setted => only 1 option (StartPage) in dictionary options = new ApiOptions @@ -98,8 +97,7 @@ public void RequestsCorrectUrlWithApiOptions() deployKeysClient.GetAll("user", "repo", options); gitHubClient.Connection.Received(1) .Get>(Arg.Is(u => u.ToString() == expectedUrl), - Arg.Is>(dictionary => dictionary.Count == 1), - null); + Arg.Is>(dictionary => dictionary.Count == 1)); // PageCount is setted => none of options in dictionary options = new ApiOptions @@ -110,8 +108,7 @@ public void RequestsCorrectUrlWithApiOptions() deployKeysClient.GetAll("user", "repo", options); gitHubClient.Connection.Received(1) .Get>(Arg.Is(u => u.ToString() == expectedUrl), - Arg.Is>(dictionary => dictionary.Count == 0), - null); + Arg.Is>(dictionary => dictionary.Count == 0)); } [Fact] @@ -132,8 +129,7 @@ public void RequestsCorrectUrlWithRepositoryIdWithApiOptions() deployKeysClient.GetAll(1, options); gitHubClient.Connection.Received(1) .Get>(Arg.Is(u => u.ToString() == expectedUrl), - Arg.Is>(dictionary => dictionary.Count == 2), - null); + Arg.Is>(dictionary => dictionary.Count == 2)); // StartPage is setted => only 1 option (StartPage) in dictionary options = new ApiOptions @@ -144,8 +140,7 @@ public void RequestsCorrectUrlWithRepositoryIdWithApiOptions() deployKeysClient.GetAll(1, options); gitHubClient.Connection.Received(1) .Get>(Arg.Is(u => u.ToString() == expectedUrl), - Arg.Is>(dictionary => dictionary.Count == 1), - null); + Arg.Is>(dictionary => dictionary.Count == 1)); // PageCount is setted => none of options in dictionary options = new ApiOptions @@ -156,8 +151,7 @@ public void RequestsCorrectUrlWithRepositoryIdWithApiOptions() deployKeysClient.GetAll(1, options); gitHubClient.Connection.Received(1) .Get>(Arg.Is(u => u.ToString() == expectedUrl), - Arg.Is>(dictionary => dictionary.Count == 0), - null); + Arg.Is>(dictionary => dictionary.Count == 0)); } [Fact] diff --git a/Octokit.Tests/Reactive/ObservableStarredClientTests.cs b/Octokit.Tests/Reactive/ObservableStarredClientTests.cs index 736f433c54..cd28b23dea 100644 --- a/Octokit.Tests/Reactive/ObservableStarredClientTests.cs +++ b/Octokit.Tests/Reactive/ObservableStarredClientTests.cs @@ -32,7 +32,7 @@ public void RequestsCorrectUrl() client.GetAllStargazers("fight", "club"); - connection.Received().Get>(endpoint, Args.EmptyDictionary, null); + connection.Received().Get>(endpoint, Args.EmptyDictionary); } [Fact] @@ -46,7 +46,7 @@ public void RequestsCorrectUrlWithRepositoryId() client.GetAllStargazers(1); - connection.Received().Get>(endpoint, Args.EmptyDictionary, null); + connection.Received().Get>(endpoint, Args.EmptyDictionary); } [Fact] @@ -67,7 +67,7 @@ public void RequestsCorrectUrlWithApiOptions() client.GetAllStargazers("fight", "club", options); - connection.Received().Get>(endpoint, Arg.Is>(d => d.Count == 2), null); + connection.Received().Get>(endpoint, Arg.Is>(d => d.Count == 2)); } [Fact] @@ -88,7 +88,7 @@ public void RequestsCorrectUrlWithApiOptionsWithRepositoryId() client.GetAllStargazers(1, options); - connection.Received().Get>(endpoint, Arg.Is>(d => d.Count == 2), null); + connection.Received().Get>(endpoint, Arg.Is>(d => d.Count == 2)); } [Fact] @@ -102,7 +102,7 @@ public void RequestsCorrectUrlWithTimestamps() client.GetAllStargazersWithTimestamps("fight", "club"); - connection.Received().Get>(endpoint, Args.EmptyDictionary, null); + connection.Received().Get>(endpoint, Args.EmptyDictionary); } [Fact] @@ -116,7 +116,7 @@ public void RequestsCorrectUrlWithTimestampsWithRepositoryId() client.GetAllStargazersWithTimestamps(1); - connection.Received().Get>(endpoint, Args.EmptyDictionary, null); + connection.Received().Get>(endpoint, Args.EmptyDictionary); } [Fact] @@ -137,7 +137,7 @@ public void RequestsCorrectUrlWithTimestampsWithApiOptions() client.GetAllStargazersWithTimestamps("fight", "club", options); - connection.Received().Get>(endpoint, Arg.Is>(d => d.Count == 2), null); + connection.Received().Get>(endpoint, Arg.Is>(d => d.Count == 2)); } [Fact] @@ -158,7 +158,7 @@ public void RequestsCorrectUrlWithTimestampsWithApiOptionsWithRepositoryId() client.GetAllStargazersWithTimestamps(1, options); - connection.Received().Get>(endpoint, Arg.Is>(d => d.Count == 2), null); + connection.Received().Get>(endpoint, Arg.Is>(d => d.Count == 2)); } [Fact] @@ -204,7 +204,7 @@ public void RequestsCorrectUrl() client.GetAllForCurrent(); - connection.Received().Get>(endpoint, Args.EmptyDictionary, null); + connection.Received().Get>(endpoint, Args.EmptyDictionary); } [Fact] @@ -225,7 +225,7 @@ public void RequestsCorrectUrlWithApiOptions() client.GetAllForCurrent(options); - connection.Received().Get>(endpoint, Arg.Is>(d => d.Count == 2 && d["per_page"] == "1" && d["page"] == "1"), null); + connection.Received().Get>(endpoint, Arg.Is>(d => d.Count == 2 && d["per_page"] == "1" && d["page"] == "1")); } [Fact] @@ -241,8 +241,7 @@ public void RequestsCorrectUrlParametrized() client.GetAllForCurrent(request); - connection.Received().Get>(endpoint, Arg.Is>(d => d.Count == 2 && d["direction"] == "asc"), - null); + connection.Received().Get>(endpoint, Arg.Is>(d => d.Count == 2 && d["direction"] == "asc")); } [Fact] @@ -266,7 +265,7 @@ public void RequestsCorrectUrlParametrizedWithApiOptions() client.GetAllForCurrent(request, options); connection.Received().Get>(endpoint, - Arg.Is>(d => d.Count == 4 && d["direction"] == "asc" && d["per_page"] == "1" && d["page"] == "1"), null); + Arg.Is>(d => d.Count == 4 && d["direction"] == "asc" && d["per_page"] == "1" && d["page"] == "1")); } [Fact] @@ -280,7 +279,7 @@ public void RequestsCorrectUrlWithTimestamps() client.GetAllForCurrentWithTimestamps(); - connection.Received().Get>(endpoint, Args.EmptyDictionary, null); + connection.Received().Get>(endpoint, Args.EmptyDictionary); } [Fact] @@ -302,8 +301,7 @@ public void RequestsCorrectUrlWithTimestampsWithApiOptions() client.GetAllForCurrentWithTimestamps(options); connection.Received().Get>(endpoint, - Arg.Is>(d => d.Count == 2 && d["per_page"] == "1" && d["page"] == "1"), - null); + Arg.Is>(d => d.Count == 2 && d["per_page"] == "1" && d["page"] == "1")); } [Fact] @@ -319,8 +317,7 @@ public void RequestsCorrectUrlWithTimestampsParametrized() client.GetAllForCurrentWithTimestamps(request); - connection.Received().Get>(endpoint, Arg.Is>(d => d.Count == 2 && d["direction"] == "asc"), - null); + connection.Received().Get>(endpoint, Arg.Is>(d => d.Count == 2 && d["direction"] == "asc")); } [Fact] @@ -344,8 +341,7 @@ public void RequestsCorrectUrlWithTimestampsParametrizedWithApiOptions() client.GetAllForCurrentWithTimestamps(request, options); connection.Received().Get>(endpoint, - Arg.Is>(d => d.Count == 4 && d["direction"] == "asc" && d["per_page"] == "1" && d["page"] == "1"), - null); + Arg.Is>(d => d.Count == 4 && d["direction"] == "asc" && d["per_page"] == "1" && d["page"] == "1")); } [Fact] @@ -378,7 +374,7 @@ public void RequestsCorrectUrl() client.GetAllForUser("banana"); - connection.Received().Get>(endpoint, Args.EmptyDictionary, null); + connection.Received().Get>(endpoint, Args.EmptyDictionary); } [Fact] @@ -400,7 +396,7 @@ public void RequestsCorrectUrlWithApiOptions() client.GetAllForUser("banana", options); connection.Received().Get>(endpoint, - Arg.Is>(d => d.Count == 2 && d["per_page"] == "1" && d["page"] == "1"), null); + Arg.Is>(d => d.Count == 2 && d["per_page"] == "1" && d["page"] == "1")); } [Fact] @@ -416,7 +412,7 @@ public void RequestsCorrectUrlParametrized() client.GetAllForUser("banana", starredRequest); - connection.Received().Get>(endpoint, Arg.Is>(d => d.Count == 2 && d["direction"] == "asc"), null); + connection.Received().Get>(endpoint, Arg.Is>(d => d.Count == 2 && d["direction"] == "asc")); } [Fact] @@ -440,8 +436,7 @@ public void RequestsCorrectUrlParametrizedWithApiOptions() client.GetAllForUser("banana", starredRequest, options); connection.Received().Get>(endpoint, - Arg.Is>(d => d.Count == 4 && d["direction"] == "asc" && d["direction"] == "asc" && d["per_page"] == "1" && d["page"] == "1"), - null); + Arg.Is>(d => d.Count == 4 && d["direction"] == "asc" && d["direction"] == "asc" && d["per_page"] == "1" && d["page"] == "1")); } [Fact] @@ -455,8 +450,7 @@ public void RequestsCorrectUrlWithTimestamps() client.GetAllForUserWithTimestamps("banana"); - connection.Received().Get>(endpoint, Args.EmptyDictionary, - null); + connection.Received().Get>(endpoint, Args.EmptyDictionary); } [Fact] @@ -478,8 +472,7 @@ public void RequestsCorrectUrlWithTimestampsWithApiOptions() client.GetAllForUserWithTimestamps("banana", options); connection.Received().Get>(endpoint, - Arg.Is>(d => d.Count == 2 && d["per_page"] == "1" && d["page"] == "1"), - null); + Arg.Is>(d => d.Count == 2 && d["per_page"] == "1" && d["page"] == "1")); } [Fact] @@ -495,8 +488,7 @@ public void RequestsCorrectUrlWithTimestampsParametrized() client.GetAllForUserWithTimestamps("banana", starredRequest); - connection.Received().Get>(endpoint, Arg.Is>(d => d.Count == 2 && d["direction"] == "asc"), - null); + connection.Received().Get>(endpoint, Arg.Is>(d => d.Count == 2 && d["direction"] == "asc")); } [Fact] @@ -519,8 +511,7 @@ public void RequestsCorrectUrlWithTimestampsParametrizedWithApiOptions() client.GetAllForUserWithTimestamps("banana", starredRequest, options); - connection.Received().Get>(endpoint, Arg.Is>(d => d.Count == 4 && d["direction"] == "asc" && d["direction"] == "asc" && d["per_page"] == "1" && d["page"] == "1"), - null); + connection.Received().Get>(endpoint, Arg.Is>(d => d.Count == 4 && d["direction"] == "asc" && d["direction"] == "asc" && d["per_page"] == "1" && d["page"] == "1")); } [Fact] diff --git a/Octokit.Tests/Reactive/ObservableTeamsClientTests.cs b/Octokit.Tests/Reactive/ObservableTeamsClientTests.cs index 66eb656276..bca96dbc2b 100644 --- a/Octokit.Tests/Reactive/ObservableTeamsClientTests.cs +++ b/Octokit.Tests/Reactive/ObservableTeamsClientTests.cs @@ -83,8 +83,7 @@ public void RequestsTheCorrectUrl() github.Connection.Received().Get>( Arg.Is(u => u.ToString() == "teams/1/members"), - Arg.Any>(), - null); + Arg.Any>()); } [Fact] @@ -97,8 +96,7 @@ public void RequestsTheCorrectUrlWithRequest() github.Connection.Received().Get>( Arg.Is(u => u.ToString() == "teams/1/members"), - Arg.Is>(d => d["role"] == "maintainer"), - null); + Arg.Is>(d => d["role"] == "maintainer")); } [Fact] @@ -164,8 +162,7 @@ public void RequestsTheCorrectUrl() gitHub.Connection.Received().Get>( Arg.Is(u => u.ToString() == "teams/1/teams"), - Args.EmptyDictionary, - null); + Args.EmptyDictionary); } [Fact] @@ -183,8 +180,7 @@ public void RequestsTheCorrectUrlWithApiOptions() gitHub.Connection.Received().Get>( Arg.Is(u => u.ToString() == "teams/1/teams"), - Arg.Is>(dictionary => dictionary.Count == 2), - null); + Arg.Is>(dictionary => dictionary.Count == 2)); } } diff --git a/Octokit.Tests/Reactive/ObservableUserAdministrationClientTests.cs b/Octokit.Tests/Reactive/ObservableUserAdministrationClientTests.cs index 5290511a11..9e807e25fe 100644 --- a/Octokit.Tests/Reactive/ObservableUserAdministrationClientTests.cs +++ b/Octokit.Tests/Reactive/ObservableUserAdministrationClientTests.cs @@ -144,7 +144,6 @@ public void RequestsTheCorrectUrl() gitHubClient.Connection.Received().Get>( Arg.Is(a => a.ToString() == expectedUri), - null, null); } } diff --git a/Octokit.Tests/Reactive/ObservableUserEmailsClientTests.cs b/Octokit.Tests/Reactive/ObservableUserEmailsClientTests.cs index ea7dc6886e..16a98e5965 100644 --- a/Octokit.Tests/Reactive/ObservableUserEmailsClientTests.cs +++ b/Octokit.Tests/Reactive/ObservableUserEmailsClientTests.cs @@ -29,7 +29,7 @@ public void GetsCorrectUrl() client.GetAll(); github.Connection.Received(1).Get>(_expectedUri, - Arg.Is>(dictionary => dictionary.Count == 0), null); + Arg.Is>(dictionary => dictionary.Count == 0)); } [Fact] @@ -41,7 +41,7 @@ public void GetsCorrectUrlWithApiOption() client.GetAll(ApiOptions.None); github.Connection.Received(1).Get>(_expectedUri, - Arg.Is>(dictionary => dictionary.Count == 0), null); + Arg.Is>(dictionary => dictionary.Count == 0)); } } diff --git a/Octokit.Tests/Reactive/ObservableWatchedClientTests.cs b/Octokit.Tests/Reactive/ObservableWatchedClientTests.cs index 9d9405cad9..2630974ac5 100644 --- a/Octokit.Tests/Reactive/ObservableWatchedClientTests.cs +++ b/Octokit.Tests/Reactive/ObservableWatchedClientTests.cs @@ -28,7 +28,7 @@ public void RequestsCorrectUrl() var client = new ObservableWatchedClient(gitHubClient); client.GetAllForCurrent(); - connection.Received().Get>(ApiUrls.Watched(), Args.EmptyDictionary, null); + connection.Received().Get>(ApiUrls.Watched(), Args.EmptyDictionary); } [Fact] @@ -47,7 +47,7 @@ public void RequestsCorrectUrlWithApiOptions() }; client.GetAllForCurrent(options); - connection.Received().Get>(ApiUrls.Watched(), Arg.Is>(d => d.Count == 2), null); + connection.Received().Get>(ApiUrls.Watched(), Arg.Is>(d => d.Count == 2)); } [Fact] @@ -70,7 +70,7 @@ public void RequestsCorrectUrl() var client = new ObservableWatchedClient(gitHubClient); client.GetAllForUser("jugglingnutcase"); - connection.Received().Get>(ApiUrls.WatchedByUser("jugglingnutcase"), Args.EmptyDictionary, null); + connection.Received().Get>(ApiUrls.WatchedByUser("jugglingnutcase"), Args.EmptyDictionary); } [Fact] @@ -89,7 +89,7 @@ public void RequestsCorrectUrlWithApiOptions() }; client.GetAllForUser("jugglingnutcase", options); - connection.Received().Get>(ApiUrls.WatchedByUser("jugglingnutcase"), Arg.Is>(d => d.Count == 2), null); + connection.Received().Get>(ApiUrls.WatchedByUser("jugglingnutcase"), Arg.Is>(d => d.Count == 2)); } [Fact] @@ -118,7 +118,7 @@ public void RequestsCorrectUrl() client.GetAllWatchers("jugglingnutcase", "katiejamie"); - connection.Received().Get>(ApiUrls.Watchers("jugglingnutcase", "katiejamie"), Args.EmptyDictionary, null); + connection.Received().Get>(ApiUrls.Watchers("jugglingnutcase", "katiejamie"), Args.EmptyDictionary); } [Fact] @@ -131,7 +131,7 @@ public void RequestsCorrectUrlWithRepositoryId() client.GetAllWatchers(1); - connection.Received().Get>(ApiUrls.Watchers(1), Args.EmptyDictionary, null); + connection.Received().Get>(ApiUrls.Watchers(1), Args.EmptyDictionary); } [Fact] @@ -151,7 +151,7 @@ public void RequestsCorrectUrlWithApiOptions() client.GetAllWatchers("jugglingnutcase", "katiejamie", options); - connection.Received().Get>(ApiUrls.Watchers("jugglingnutcase", "katiejamie"), Arg.Is>(d => d.Count == 2), null); + connection.Received().Get>(ApiUrls.Watchers("jugglingnutcase", "katiejamie"), Arg.Is>(d => d.Count == 2)); } [Fact] @@ -171,7 +171,7 @@ public void RequestsCorrectUrlWithRepositoryIdWithApiOptions() client.GetAllWatchers(1, options); - connection.Received().Get>(ApiUrls.Watchers(1), Arg.Is>(d => d.Count == 2), null); + connection.Received().Get>(ApiUrls.Watchers(1), Arg.Is>(d => d.Count == 2)); } [Fact] diff --git a/Octokit/Helpers/ApiExtensions.cs b/Octokit/Helpers/ApiExtensions.cs index 7cd04ab9ca..4c7e88d648 100644 --- a/Octokit/Helpers/ApiExtensions.cs +++ b/Octokit/Helpers/ApiExtensions.cs @@ -69,7 +69,7 @@ public static Task> GetResponse(this IConnection connection, Ensure.ArgumentNotNull(connection, nameof(connection)); Ensure.ArgumentNotNull(uri, nameof(uri)); - return connection.Get(uri, null, null); + return connection.Get(uri, null); } /// diff --git a/Octokit/Http/Connection.cs b/Octokit/Http/Connection.cs index 4f30d5c0ed..9c247c502c 100644 --- a/Octokit/Http/Connection.cs +++ b/Octokit/Http/Connection.cs @@ -172,6 +172,13 @@ public ApiInfo GetLastApiInfo() } private ApiInfo _lastApiInfo; + public Task> Get(Uri uri, IDictionary parameters) + { + Ensure.ArgumentNotNull(uri, nameof(uri)); + + return SendData(uri.ApplyParameters(parameters), HttpMethod.Get, null, null, null, CancellationToken.None); + } + public Task> Get(Uri uri, IDictionary parameters, string accepts) { Ensure.ArgumentNotNull(uri, nameof(uri)); diff --git a/Octokit/Http/IConnection.cs b/Octokit/Http/IConnection.cs index 73594c3441..f53f361be9 100644 --- a/Octokit/Http/IConnection.cs +++ b/Octokit/Http/IConnection.cs @@ -29,6 +29,16 @@ public interface IConnection : IApiInfoProvider /// The property will be null if the points to a directory instead of a file Task> GetRaw(Uri uri, IDictionary parameters); + /// + /// Performs an asynchronous HTTP GET request. + /// Attempts to map the response to an object of type + /// + /// The type to map the response to + /// URI endpoint to send request to + /// Querystring parameters for the request + /// representing the received HTTP response + Task> Get(Uri uri, IDictionary parameters); + /// /// Performs an asynchronous HTTP GET request. /// Attempts to map the response to an object of type From a1dd132f1d96c112da7f8bbfcf48edb3fc9f8995 Mon Sep 17 00:00:00 2001 From: Chris Simpson Date: Mon, 1 Aug 2022 06:20:00 +0100 Subject: [PATCH 4/4] Fixing merge issues --- .../Clients/RepositoriesClientTests.cs | 51 ++++++++----------- 1 file changed, 20 insertions(+), 31 deletions(-) diff --git a/Octokit.Tests/Clients/RepositoriesClientTests.cs b/Octokit.Tests/Clients/RepositoriesClientTests.cs index 40755b46fd..40f72252b2 100644 --- a/Octokit.Tests/Clients/RepositoriesClientTests.cs +++ b/Octokit.Tests/Clients/RepositoriesClientTests.cs @@ -44,8 +44,7 @@ public void UsesTheUserReposUrl() client.Create(new NewRepository("aName")); connection.Received().Post(Arg.Is(u => u.ToString() == "user/repos"), - Arg.Any(), - "application/vnd.github.nebula-preview+json,application/vnd.github.baptiste-preview+json"); + Arg.Any()); } [Fact] @@ -57,7 +56,7 @@ public void TheNewRepositoryDescription() client.Create(newRepository); - connection.Received().Post(Args.Uri, newRepository, "application/vnd.github.nebula-preview+json,application/vnd.github.baptiste-preview+json"); + connection.Received().Post(Args.Uri, newRepository); } [Fact] @@ -73,7 +72,7 @@ public async Task ThrowsRepositoryExistsExceptionWhenRepositoryExistsForCurrentU var connection = Substitute.For(); connection.Connection.BaseAddress.Returns(GitHubClient.GitHubApiUrl); connection.Connection.Credentials.Returns(credentials); - connection.Post(Args.Uri, newRepository, "application/vnd.github.nebula-preview+json,application/vnd.github.baptiste-preview+json") + connection.Post(Args.Uri, newRepository) .Returns>(_ => { throw new ApiValidationException(response); }); var client = new RepositoriesClient(connection); @@ -110,8 +109,7 @@ public async Task UsesTheOrganizationsReposUrl() connection.Received().Post( Arg.Is(u => u.ToString() == "orgs/theLogin/repos"), - Args.NewRepository, - "application/vnd.github.nebula-preview+json,application/vnd.github.baptiste-preview+json"); + Args.NewRepository); } [Fact] @@ -123,7 +121,7 @@ public async Task TheNewRepositoryDescription() await client.Create("aLogin", newRepository); - connection.Received().Post(Args.Uri, newRepository, "application/vnd.github.nebula-preview+json,application/vnd.github.baptiste-preview+json"); + connection.Received().Post(Args.Uri, newRepository); } [Fact] @@ -137,7 +135,7 @@ public async Task ThrowsRepositoryExistsExceptionWhenRepositoryExistsForSpecifie + @"""code"":""custom"",""field"":""name"",""message"":""name already exists on this account""}]}"); var connection = Substitute.For(); connection.Connection.BaseAddress.Returns(GitHubClient.GitHubApiUrl); - connection.Post(Args.Uri, newRepository, "application/vnd.github.nebula-preview+json,application/vnd.github.baptiste-preview+json") + connection.Post(Args.Uri, newRepository) .Returns>(_ => { throw new ApiValidationException(response); }); var client = new RepositoriesClient(connection); @@ -162,7 +160,7 @@ public async Task ThrowsValidationException() + @"""http://developer.github.com/v3/repos/#create"",""errors"":[]}"); var connection = Substitute.For(); connection.Connection.BaseAddress.Returns(GitHubClient.GitHubApiUrl); - connection.Post(Args.Uri, newRepository, "application/vnd.github.nebula-preview+json,application/vnd.github.baptiste-preview+json") + connection.Post(Args.Uri, newRepository) .Returns>(_ => { throw new ApiValidationException(response); }); var client = new RepositoriesClient(connection); @@ -183,7 +181,7 @@ public async Task ThrowsRepositoryExistsExceptionForEnterpriseInstance() + @"""code"":""custom"",""field"":""name"",""message"":""name already exists on this account""}]}"); var connection = Substitute.For(); connection.Connection.BaseAddress.Returns(new Uri("https://example.com")); - connection.Post(Args.Uri, newRepository, "application/vnd.github.nebula-preview+json,application/vnd.github.baptiste-preview+json") + connection.Post(Args.Uri, newRepository) .Returns>(_ => { throw new ApiValidationException(response); }); var client = new RepositoriesClient(connection); @@ -216,8 +214,7 @@ public void UsesTheUserReposUrl() client.Generate("asd", "asd", new NewRepositoryFromTemplate("aName")); connection.Received().Post(Arg.Is(u => u.ToString() == "repos/asd/asd/generate"), - Arg.Any(), - "application/vnd.github.baptiste-preview+json"); + Arg.Any()); } [Fact] @@ -229,7 +226,7 @@ public void TheNewRepositoryDescription() client.Generate("anOwner", "aRepo", newRepository); - connection.Received().Post(Args.Uri, newRepository, "application/vnd.github.baptiste-preview+json"); + connection.Received().Post(Args.Uri, newRepository); } } @@ -474,8 +471,7 @@ public async Task RequestsCorrectUrl() connection.Received() .Get(Arg.Is(u => u.ToString() == "repos/owner/name"), - null, - "application/vnd.github.nebula-preview+json"); + null); } [Fact] @@ -558,7 +554,6 @@ public async Task RequestsTheCorrectUrlAndReturnsRepositories() connection.Received() .GetAll(Arg.Is(u => u.ToString() == "user/repos"), null, - "application/vnd.github.nebula-preview+json,application/vnd.github.baptiste-preview+json", Args.ApiOptions); } @@ -579,7 +574,6 @@ public async Task CanFilterByType() .GetAll( Arg.Is(u => u.ToString() == "user/repos"), Arg.Is>(d => d["type"] == "all"), - "application/vnd.github.nebula-preview+json", Args.ApiOptions); } @@ -601,7 +595,6 @@ public async Task CanFilterBySort() .GetAll( Arg.Is(u => u.ToString() == "user/repos"), Arg.Is>(d => d["type"] == "private" && d["sort"] == "full_name"), - "application/vnd.github.nebula-preview+json", Args.ApiOptions); } @@ -624,7 +617,6 @@ public async Task CanFilterBySortDirection() .GetAll( Arg.Is(u => u.ToString() == "user/repos"), Arg.Is>(d => d["type"] == "member" && d["sort"] == "updated" && d["direction"] == "asc"), - "application/vnd.github.nebula-preview+json", Args.ApiOptions); } @@ -645,7 +637,6 @@ public async Task CanFilterByVisibility() .GetAll( Arg.Is(u => u.ToString() == "user/repos"), Arg.Is>(d => d["visibility"] == "private"), - "application/vnd.github.nebula-preview+json", Args.ApiOptions); } @@ -667,7 +658,6 @@ public async Task CanFilterByAffiliation() .GetAll( Arg.Is(u => u.ToString() == "user/repos"), Arg.Is>(d => d["affiliation"] == "owner" && d["sort"] == "full_name"), - "application/vnd.github.nebula-preview+json", Args.ApiOptions); } } @@ -712,7 +702,7 @@ public async Task RequestsTheCorrectUrl() await client.GetAllForOrg("orgname"); connection.Received() - .GetAll(Arg.Is(u => u.ToString() == "orgs/orgname/repos"), null, "application/vnd.github.nebula-preview+json,application/vnd.github.baptiste-preview+json", Args.ApiOptions); + .GetAll(Arg.Is(u => u.ToString() == "orgs/orgname/repos"), null, Args.ApiOptions); } [Fact] @@ -1145,8 +1135,7 @@ public void PatchesCorrectUrl() connection.Received() .Patch(Arg.Is(u => u.ToString() == "repos/owner/repo"), - Arg.Any(), - "application/vnd.github.nebula-preview+json,application/vnd.github.baptiste-preview+json"); + Arg.Any()); } [Fact] @@ -1316,7 +1305,7 @@ public void RequestsTheCorrectUrl() client.GetSha1("owner", "name", "reference"); connection.Received() - .Get(Arg.Is(u => u.ToString() == "repos/owner/name/commits/reference"), null, "application/vnd.github.v3.sha"); + .Get(Arg.Is(u => u.ToString() == "repos/owner/name/commits/reference"), null); } } @@ -1349,7 +1338,7 @@ public void RequestsTheCorrectUrlForOwnerAndRepo() client.GetAllTopics("owner", "name"); connection.Received() - .Get(Arg.Is(u => u.ToString() == "repos/owner/name/topics"), null, "application/vnd.github.mercy-preview+json"); + .Get(Arg.Is(u => u.ToString() == "repos/owner/name/topics"), null); } [Fact] @@ -1361,7 +1350,7 @@ public void RequestsTheCorrectUrlForRepoId() client.GetAllTopics(1234); connection.Received() - .Get(Arg.Is(u => u.ToString() == "repositories/1234/topics"), null, "application/vnd.github.mercy-preview+json"); + .Get(Arg.Is(u => u.ToString() == "repositories/1234/topics"), null); } } @@ -1400,7 +1389,7 @@ public async Task RequestsTheCorrectUrlForOwnerAndRepoWithEmptyTopics() await _client.ReplaceAllTopics("owner", "name", _emptyTopics); _connection.Received() - .Put(Arg.Is(u => u.ToString() == "repos/owner/name/topics"), _emptyTopics, null, "application/vnd.github.mercy-preview+json"); + .Put(Arg.Is(u => u.ToString() == "repos/owner/name/topics"), _emptyTopics, null); } [Fact] @@ -1409,7 +1398,7 @@ public async Task RequestsTheCorrectUrlForOwnerAndRepoWithListOfTopics() await _client.ReplaceAllTopics("owner", "name", _listOfTopics); _connection.Received() - .Put(Arg.Is(u => u.ToString() == "repos/owner/name/topics"), _listOfTopics, null, "application/vnd.github.mercy-preview+json"); + .Put(Arg.Is(u => u.ToString() == "repos/owner/name/topics"), _listOfTopics, null); } [Fact] @@ -1418,7 +1407,7 @@ public async Task RequestsTheCorrectUrlForRepoIdWithEmptyTopics() await _client.ReplaceAllTopics(1234, _emptyTopics); _connection.Received() - .Put(Arg.Is(u => u.ToString() == "repositories/1234/topics"), _emptyTopics, null, "application/vnd.github.mercy-preview+json"); + .Put(Arg.Is(u => u.ToString() == "repositories/1234/topics"), _emptyTopics, null); } [Fact] @@ -1427,7 +1416,7 @@ public async Task RequestsTheCorrectUrlForRepoIdWithListOfTopics() await _client.ReplaceAllTopics(1234, _listOfTopics); _connection.Received() - .Put(Arg.Is(u => u.ToString() == "repositories/1234/topics"), _listOfTopics, null, "application/vnd.github.mercy-preview+json"); + .Put(Arg.Is(u => u.ToString() == "repositories/1234/topics"), _listOfTopics, null); } } }