public void NegotiateListIssuesParametersReturnsFailureForMissingProject(ListIssuesOptions options, string defaultIssuesLabel) { options.Project = ""; var sut = new IssueParametersNegotiator(); sut.NegotiateListIssuesParameters(options, "", defaultIssuesLabel).IsFailure.Should().BeTrue(); }
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(); }
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); }
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)); }
public Result <ListIssuesParameters> NegotiateListIssuesParameters(ListIssuesOptions options) { return(_issueParametersNegotiator.NegotiateListIssuesParameters(options, _appSettings.DefaultProject, _appSettings.DefaulIssuesLabel)); }