Exemplo n.º 1
0
        public void NegotiateCloseIssueParametersReturnsFailureForMissingProject(CloseIssueOptions options)
        {
            options.Project = "";
            var sut = new IssueParametersNegotiator();

            sut.NegotiateCloseIssueParameters(options, "").IsFailure.Should().BeTrue();
        }
Exemplo n.º 2
0
        public void NegotiateCloseIssueParametersCreatesParametersFromOptions(CloseIssueOptions options, string defaultProject)
        {
            var sut = new IssueParametersNegotiator();

            sut.NegotiateCloseIssueParameters(options, defaultProject).Value.Should().Match <CloseIssueParameters>(o =>
                                                                                                                   o.IssueId == options.Id &&
                                                                                                                   o.Project == options.Project);
        }
        public Result <CloseIssueParameters> NegotiateCloseIssueParameters(CloseIssueOptions options, string defaultProject)
        {
            var project = GetProject(options, defaultProject);

            if (project.IsFailure)
            {
                return(Fail <CloseIssueParameters>(project));
            }

            return(Ok(new CloseIssueParameters(project.Value, options.Id)));
        }
Exemplo n.º 4
0
        public async Task Visit(CloseIssueOptions options)
        {
            if (!ValidateConfiguration())
            {
                return;
            }

            var parameters = _parametersHandler.NegotiateCloseIssueParameters(options);

            if (parameters.IsSuccess)
            {
                await _issuesHandler.CloseIssue(parameters.Value);
            }
            else
            {
                ShowError(parameters);
            }
        }
Exemplo n.º 5
0
 public Result <CloseIssueParameters> NegotiateCloseIssueParameters(CloseIssueOptions options)
 {
     return(_issueParametersNegotiator.NegotiateCloseIssueParameters(options, _appSettings.DefaultProject));
 }