public static AzureDevOpsPullRequest AzureDevOpsCreatePullRequest(
            this ICakeContext context,
            AzureDevOpsCreatePullRequestSettings settings)
        {
            context.NotNull(nameof(context));
            context.NotNull(nameof(settings));

            return(PullRequest.AzureDevOpsPullRequest.Create(context.Log, new GitClientFactory(), settings));
        }
            public void Should_Set_Description(string description)
            {
                // Given
                var repositoryUrl = new Uri("http://example.com");
                var sourceRefName = "foo";
                var targetRefName = "master";
                var title         = "foo";
                var credentials   = AuthenticationProvider.AuthenticationNtlm();

                // When
                var result =
                    new AzureDevOpsCreatePullRequestSettings(repositoryUrl, sourceRefName, targetRefName, title, description, credentials);

                // Then
                result.Description.ShouldBe(description);
            }
示例#3
0
            public void Should_Throw_If_Settings_Are_Null()
            {
                // Given
                var fixture =
                    new CreatePullRequestFixture(
                        BasePullRequestFixture.ValidAzureDevOpsServerUrl,
                        "testBranch",
                        "NotExistingBranch",
                        "test",
                        "test");
                AzureDevOpsCreatePullRequestSettings settings = null;

                // When
                var result =
                    Record.Exception(() => AzureDevOpsPullRequest.Create(fixture.Log, fixture.GitClientFactory, settings));

                // Then
                result.IsArgumentNullException("settings");
            }