mirror of
https://github.com/zoriya/octokit.net.git
synced 2026-06-07 12:26:18 +00:00
Fix existing unit tests
This commit is contained in:
@@ -55,13 +55,15 @@ namespace Octokit.Tests.Clients
|
||||
var connection = Substitute.For<IApiConnection>();
|
||||
var client = new PullRequestsClient(connection);
|
||||
|
||||
client.GetForRepository("fake", "repo", new PullRequestRequest { Head = "user:ref-head", Base = "fake_base_branch" });
|
||||
client.GetForRepository("fake", "repo", new PullRequestRequest { Head = "user:ref-head", Base = "fake_base_branch"});
|
||||
|
||||
connection.Received().GetAll<PullRequest>(Arg.Is<Uri>(u => u.ToString() == "repos/fake/repo/pulls"),
|
||||
Arg.Is<Dictionary<string, string>>(d => d.Count == 3
|
||||
Arg.Is<Dictionary<string, string>>(d => d.Count == 5
|
||||
&& d["head"] == "user:ref-head"
|
||||
&& d["state"] == "open"
|
||||
&& d["base"] == "fake_base_branch"));
|
||||
&& d["base"] == "fake_base_branch"
|
||||
&& d["sort"] == "created"
|
||||
&& d["direction"] == "desc"));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -131,10 +131,12 @@ namespace Octokit.Tests.Reactive
|
||||
);
|
||||
var gitHubClient = Substitute.For<IGitHubClient>();
|
||||
gitHubClient.Connection.Get<List<PullRequest>>(Arg.Is(firstPageUrl),
|
||||
Arg.Is<Dictionary<string, string>>(d => d.Count == 3
|
||||
Arg.Is<Dictionary<string, string>>(d => d.Count == 5
|
||||
&& d["head"] == "user:ref-name"
|
||||
&& d["state"] == "open"
|
||||
&& d["base"] == "fake_base_branch"), Arg.Any<string>())
|
||||
&& d["base"] == "fake_base_branch"
|
||||
&& d["sort"] == "created"
|
||||
&& d["direction"] == "desc"), Arg.Any<string>())
|
||||
.Returns(Task.Factory.StartNew<IApiResponse<List<PullRequest>>>(() => firstPageResponse));
|
||||
gitHubClient.Connection.Get<List<PullRequest>>(secondPageUrl, null, null)
|
||||
.Returns(Task.Factory.StartNew<IApiResponse<List<PullRequest>>>(() => secondPageResponse));
|
||||
|
||||
Reference in New Issue
Block a user