public async Task PostsToCorrectUrlWithRepositoryId() { var pullRequestUpdate = new PullRequestUpdate(); var connection = Substitute.For <IApiConnection>(); var client = new PullRequestsClient(connection); await client.Update(1, 42, pullRequestUpdate); connection.Received().Patch <PullRequest>(Arg.Is <Uri>(u => u.ToString() == "repositories/1/pulls/42"), pullRequestUpdate, "application/vnd.github.shadow-cat-preview+json"); }
public void PostsToCorrectUrl() { var pullRequestUpdate = new PullRequestUpdate(); var connection = Substitute.For<IApiConnection>(); var client = new PullRequestsClient(connection); client.Update("fake", "repo", 42, pullRequestUpdate); connection.Received().Patch<PullRequest>(Arg.Is<Uri>(u => u.ToString() == "repos/fake/repo/pulls/42"), pullRequestUpdate); }
public async Task PostsToCorrectUrlWithRepositoryId() { var pullRequestUpdate = new PullRequestUpdate(); var connection = Substitute.For<IApiConnection>(); var client = new PullRequestsClient(connection); await client.Update(1, 42, pullRequestUpdate); connection.Received().Patch<PullRequest>(Arg.Is<Uri>(u => u.ToString() == "repositories/1/pulls/42"), pullRequestUpdate); }