mirror of
https://github.com/zoriya/octokit.net.git
synced 2026-06-07 20:30:41 +00:00
Implement Draft Pull Requests (#2009)
* Add draft PR preview header * Add Draft property to models * Update pull requests client and tests to use draft PR accept header * Update observable pull requests client and tests to use draft PR accept header * Add integration tests to create and retrieve draft pull requests
This commit is contained in:
committed by
Brendan Forster
parent
d955d7facd
commit
fafbf33b78
@@ -209,11 +209,11 @@ namespace Octokit.Tests.Reactive
|
||||
}
|
||||
);
|
||||
var gitHubClient = Substitute.For<IGitHubClient>();
|
||||
gitHubClient.Connection.Get<List<PullRequest>>(firstPageUrl, Args.EmptyDictionary, null)
|
||||
gitHubClient.Connection.Get<List<PullRequest>>(firstPageUrl, Args.EmptyDictionary, "application/vnd.github.shadow-cat-preview+json")
|
||||
.Returns(Task.Factory.StartNew<IApiResponse<List<PullRequest>>>(() => firstPageResponse));
|
||||
gitHubClient.Connection.Get<List<PullRequest>>(secondPageUrl, Args.EmptyDictionary, null)
|
||||
gitHubClient.Connection.Get<List<PullRequest>>(secondPageUrl, Args.EmptyDictionary, "application/vnd.github.shadow-cat-preview+json")
|
||||
.Returns(Task.Factory.StartNew<IApiResponse<List<PullRequest>>>(() => secondPageResponse));
|
||||
gitHubClient.Connection.Get<List<PullRequest>>(thirdPageUrl, Args.EmptyDictionary, null)
|
||||
gitHubClient.Connection.Get<List<PullRequest>>(thirdPageUrl, Args.EmptyDictionary, "application/vnd.github.shadow-cat-preview+json")
|
||||
.Returns(Task.Factory.StartNew<IApiResponse<List<PullRequest>>>(() => lastPageResponse));
|
||||
var client = new ObservablePullRequestsClient(gitHubClient);
|
||||
|
||||
@@ -262,11 +262,11 @@ namespace Octokit.Tests.Reactive
|
||||
}
|
||||
);
|
||||
var gitHubClient = Substitute.For<IGitHubClient>();
|
||||
gitHubClient.Connection.Get<List<PullRequest>>(firstPageUrl, Args.EmptyDictionary, null)
|
||||
gitHubClient.Connection.Get<List<PullRequest>>(firstPageUrl, Args.EmptyDictionary, "application/vnd.github.shadow-cat-preview+json")
|
||||
.Returns(Task.Factory.StartNew<IApiResponse<List<PullRequest>>>(() => firstPageResponse));
|
||||
gitHubClient.Connection.Get<List<PullRequest>>(secondPageUrl, Args.EmptyDictionary, null)
|
||||
gitHubClient.Connection.Get<List<PullRequest>>(secondPageUrl, Args.EmptyDictionary, "application/vnd.github.shadow-cat-preview+json")
|
||||
.Returns(Task.Factory.StartNew<IApiResponse<List<PullRequest>>>(() => secondPageResponse));
|
||||
gitHubClient.Connection.Get<List<PullRequest>>(thirdPageUrl, Args.EmptyDictionary, null)
|
||||
gitHubClient.Connection.Get<List<PullRequest>>(thirdPageUrl, Args.EmptyDictionary, "application/vnd.github.shadow-cat-preview+json")
|
||||
.Returns(Task.Factory.StartNew<IApiResponse<List<PullRequest>>>(() => lastPageResponse));
|
||||
var client = new ObservablePullRequestsClient(gitHubClient);
|
||||
|
||||
@@ -321,21 +321,21 @@ namespace Octokit.Tests.Reactive
|
||||
&& d["state"] == "open"
|
||||
&& d["base"] == "fake_base_branch"
|
||||
&& d["sort"] == "created"
|
||||
&& d["direction"] == "desc"), Arg.Any<string>())
|
||||
&& d["direction"] == "desc"), "application/vnd.github.shadow-cat-preview+json")
|
||||
.Returns(Task.Factory.StartNew<IApiResponse<List<PullRequest>>>(() => firstPageResponse));
|
||||
gitHubClient.Connection.Get<List<PullRequest>>(secondPageUrl, Arg.Is<Dictionary<string, string>>(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"), "application/vnd.github.shadow-cat-preview+json")
|
||||
.Returns(Task.Factory.StartNew<IApiResponse<List<PullRequest>>>(() => secondPageResponse));
|
||||
gitHubClient.Connection.Get<List<PullRequest>>(thirdPageUrl, Arg.Is<Dictionary<string, string>>(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"), "application/vnd.github.shadow-cat-preview+json")
|
||||
.Returns(Task.Factory.StartNew<IApiResponse<List<PullRequest>>>(() => lastPageResponse));
|
||||
var client = new ObservablePullRequestsClient(gitHubClient);
|
||||
|
||||
@@ -390,21 +390,21 @@ namespace Octokit.Tests.Reactive
|
||||
&& d["state"] == "open"
|
||||
&& d["base"] == "fake_base_branch"
|
||||
&& d["sort"] == "created"
|
||||
&& d["direction"] == "desc"), Arg.Any<string>())
|
||||
&& d["direction"] == "desc"), "application/vnd.github.shadow-cat-preview+json")
|
||||
.Returns(Task.Factory.StartNew<IApiResponse<List<PullRequest>>>(() => firstPageResponse));
|
||||
gitHubClient.Connection.Get<List<PullRequest>>(secondPageUrl, Arg.Is<Dictionary<string, string>>(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"), "application/vnd.github.shadow-cat-preview+json")
|
||||
.Returns(Task.Factory.StartNew<IApiResponse<List<PullRequest>>>(() => secondPageResponse));
|
||||
gitHubClient.Connection.Get<List<PullRequest>>(thirdPageUrl, Arg.Is<Dictionary<string, string>>(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"), "application/vnd.github.shadow-cat-preview+json")
|
||||
.Returns(Task.Factory.StartNew<IApiResponse<List<PullRequest>>>(() => lastPageResponse));
|
||||
var client = new ObservablePullRequestsClient(gitHubClient);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user