Renamed the AgentNameValidationRule type in the library target as CamelCaseValidationRule.

This commit is contained in:
2025-10-13 00:17:22 +02:00
parent b13e139237
commit c324affad1
4 changed files with 23 additions and 21 deletions
@@ -25,7 +25,7 @@ struct ValidateInputUseCaseTests {
@Test(arguments: zip(
Input.inputsAgentName,
Output.inputsAgentName
)) func `validate agent name`(
)) func `validate camel case`(
input: String,
expects error: InputValidationError?
) async throws {
@@ -106,15 +106,15 @@ struct ValidateInputUseCaseTests {
)
}
#else
@Test("validate agent name", arguments: zip(
Input.inputsAgentName,
Output.inputsAgentName
)) func validateAgentName(
@Test("validate camel case", arguments: zip(
Input.inputsCamelCase,
Output.inputsCamelCase
)) func validateCamelCase(
input: String,
expects error: InputValidationError?
) async throws {
try assertValidate(
rule: .agentName,
rule: .camelCase,
input: input,
expects: error
)
@@ -231,8 +231,8 @@ private extension ValidateInputUseCaseTests {
// MARK: - Constants
private extension Input {
/// A list of inputs to validate against a user agent name validation rule.
static let inputsAgentName: [String] = ["SampleApp", "Sample4pp", "SampleApp1", "SampleApp🚀", "Sample App", "Sample-App", "Sample_App"]
/// A list of inputs to validate against a camel-case validation rule.
static let inputsCamelCase: [String] = ["SampleApp", "Sample4pp", "SampleApp1", "SampleApp🚀", "Sample App", "Sample-App", "Sample_App"]
/// A list of inputs to validate against the not empty validation rule.
static let inputsNotEmpty: [String] = ["Something", .empty]
/// A list of inputs to validate against the not nil validation rule.
@@ -246,8 +246,8 @@ private extension Input {
}
private extension Output {
/// A list of expected input validation errors to be thrown after validating inputs against the user agent name validation rule.
static let inputsAgentName: [InputValidationError?] = [nil, nil, nil, .inputNotAgentName, .inputNotAgentName, .inputNotAgentName, .inputNotAgentName]
/// A list of expected input validation errors to be thrown after validating inputs against the camel-case validation rule.
static let inputsCamelCase: [InputValidationError?] = [nil, nil, nil, .inputNotCamelCase, .inputNotCamelCase, .inputNotCamelCase, .inputNotCamelCase]
/// A list of expected input validation errors to be thrown after validating inputs against the not empty validation rule.
static let inputsNotEmpty: [InputValidationError?] = [nil, .inputIsEmpty]
/// A list of expected input validation errors to be thrown after validating inputs against the not nil validation rule.