Create() 공개 메소드

Creates a pull request for the specified repository.
http://developer.github.com/v3/pulls/#create-a-pull-request
public Create ( long repositoryId, NewPullRequest newPullRequest ) : IObservable
repositoryId long The Id of the repository
newPullRequest NewPullRequest A instance describing the new PullRequest to create
리턴 IObservable
            public void CreatesFromClientRepositoryPullRequest()
            {
                var newPullRequest = new NewPullRequest("some title", "branch:name", "branch:name");
                var gitHubClient = Substitute.For<IGitHubClient>();
                var client = new ObservablePullRequestsClient(gitHubClient);

                client.Create("fake", "repo", newPullRequest);

                gitHubClient.Repository.PullRequest.Received().Create("fake", "repo", newPullRequest);
            }
            public async Task EnsuresArgumentsNotNull()
            {
                var gitHubClient = Substitute.For<IGitHubClient>();
                var client = new ObservablePullRequestsClient(gitHubClient);

                await Assert.ThrowsAsync<ArgumentNullException>(() =>
                    client.Create(null, "name", new NewPullRequest("title", "ref", "ref2")).ToTask());
                await Assert.ThrowsAsync<ArgumentException>(() =>
                    client.Create("", "name", new NewPullRequest("title", "ref", "ref2")).ToTask());
                await Assert.ThrowsAsync<ArgumentNullException>(() =>
                    client.Create("owner", null, new NewPullRequest("title", "ref", "ref2")).ToTask());
                await Assert.ThrowsAsync<ArgumentException>(() =>
                    client.Create("owner", "", new NewPullRequest("title", "ref", "ref2")).ToTask());
                await Assert.ThrowsAsync<ArgumentNullException>(() =>
                    client.Create("owner", "name", null).ToTask());
            }
            public void EnsuresNonNullArguments()
            {
                var gitHubClient = Substitute.For<IGitHubClient>();
                var client = new ObservablePullRequestsClient(gitHubClient);

                Assert.Throws<ArgumentNullException>(() => client.Create(null, "name", new NewPullRequest("title", "ref", "ref2")));
                Assert.Throws<ArgumentNullException>(() => client.Create("owner", null, new NewPullRequest("title", "ref", "ref2")));
                Assert.Throws<ArgumentNullException>(() => client.Create("owner", "name", null));

                Assert.Throws<ArgumentNullException>(() => client.Create(1, null));

                Assert.Throws<ArgumentException>(() => client.Create("", "name", new NewPullRequest("title", "ref", "ref2")));
                Assert.Throws<ArgumentException>(() => client.Create("owner", "", new NewPullRequest("title", "ref", "ref2")));
            }