/// <summary> /// Sets the rule and priority of the issue. /// </summary> /// <param name="issueBuilder">Issue builder on which the properties should be set.</param> /// <param name="ruleDescription">Rule metadata.</param> /// <returns>Issue Builder instance.</returns> public static IssueBuilder OfRule(this IssueBuilder issueBuilder, BaseGitRepositoryIssuesRuleDescription ruleDescription) { issueBuilder.NotNull(nameof(issueBuilder)); ruleDescription.NotNull(nameof(ruleDescription)); return (issueBuilder .OfRule( ruleDescription.RuleName, new Uri($"https://cakeissues.net/docs/issue-providers/gitrepository/rules/{ruleDescription.RuleName}")) .WithPriority(ruleDescription.Priority)); }
public void Should_Throw_If_IssueBuilder_Is_Null() { // Given IssueBuilder issueBuilder = null; var ruleDescription = new BinaryFileNotTrackedByLfsRuleDescription(); // When var result = Record.Exception(() => issueBuilder.OfRule(ruleDescription)); // Then result.IsArgumentNullException("issueBuilder"); }