Exemplo n.º 1
0
        public void NegotiateListIssuesParametersReturnsFailureForMissingProject(ListIssuesOptions options, string defaultIssuesLabel)
        {
            options.Project = "";
            var sut = new IssueParametersNegotiator();

            sut.NegotiateListIssuesParameters(options, "", defaultIssuesLabel).IsFailure.Should().BeTrue();
        }
Exemplo n.º 2
0
        public void NegotiateListIssuesParametersReturnsFailureForUnknownOutputType(
            ListIssuesOptions options,
            string defaultProject,
            string defaultIssuesLabel,
            string unknownOutputType)
        {
            options.Output = unknownOutputType;
            var sut = new IssueParametersNegotiator();

            sut.NegotiateListIssuesParameters(options, defaultProject, defaultIssuesLabel).IsFailure.Should().BeTrue();
        }
Exemplo n.º 3
0
        public void NegotiateListIssueParametersTakesLabelsFromOptions(
            ListIssuesOptions options,
            string defaultProject,
            string defaultIssuesLabel)
        {
            options.Output = "rows";
            options.State  = "opened";
            var sut = new IssueParametersNegotiator();

            sut.NegotiateListIssuesParameters(options, defaultProject, defaultIssuesLabel).
            Value.Labels.
            Should().
            BeEquivalentTo(options.Labels);
        }
Exemplo n.º 4
0
        public void NegotiateListIssuesParametersCreatesParametersFromOptions(
            ListIssuesOptions options,
            string defaultProject,
            string defaultIssuesLabel)
        {
            options.Output = "rows";
            options.State  = "opened";
            var sut = new IssueParametersNegotiator();

            sut.NegotiateListIssuesParameters(options, defaultProject, defaultIssuesLabel).Value.
            Should().
            Match <ListIssuesParameters>(o =>
                                         o.Project == options.Project &&
                                         o.Assignee == options.Assignee &&
                                         o.Filter == options.Filter &&
                                         o.Output == OutputFormat.Rows &&
                                         o.AssignedToCurrentUser == options.AssignedToMe &&
                                         o.IssueState == IssueState.Opened &&
                                         o.IssuesIds.SequenceEqual(options.Ids) &&
                                         o.Labels.SequenceEqual(options.Labels));
        }
Exemplo n.º 5
0
 public Result <ListIssuesParameters> NegotiateListIssuesParameters(ListIssuesOptions options)
 {
     return(_issueParametersNegotiator.NegotiateListIssuesParameters(options, _appSettings.DefaultProject, _appSettings.DefaulIssuesLabel));
 }