< Summary - Heimdall API

Information
Class: ArturRios.Heimdall.Command.Input.Validation.PasswordRecoveryCommandValidator
Assembly: ArturRios.Heimdall.Command
File(s): /home/runner/work/heimdall-api/heimdall-api/src/Application/ArturRios.Heimdall.Command/Input/Validation/PasswordRecoveryCommandValidator.cs
Line coverage
100%
Covered lines: 5
Uncovered lines: 0
Coverable lines: 5
Total lines: 25
Line coverage: 100%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage
100%
Covered methods: 1
Fully covered methods: 1
Total methods: 1
Method coverage: 100%
Full method coverage: 100%

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
.ctor()100%11100%

File(s)

/home/runner/work/heimdall-api/heimdall-api/src/Application/ArturRios.Heimdall.Command/Input/Validation/PasswordRecoveryCommandValidator.cs

#LineLine coverage
 1using ArturRios.Heimdall.Shared.Messages;
 2using FluentValidation;
 3
 4namespace ArturRios.Heimdall.Command.Input.Validation;
 5
 6/// <summary>
 7///     Shape validation for <see cref="PasswordRecoveryCommand" /> (UC-12, NFR-10). Whether the
 8///     address belongs to anyone is the handler's business, and it answers the same way either way
 9///     (AF-12a).
 10/// </summary>
 11/// <remarks>
 12///     UC-12 lists no validation alternative flow, but NFR-10 requires every input to be validated,
 13///     so a missing or malformed address is refused as a bad request before any lookup runs. That
 14///     costs nothing in enumeration terms: a caller learns their own address is malformed, never
 15///     whether it is registered.
 16/// </remarks>
 17public class PasswordRecoveryCommandValidator : AbstractValidator<PasswordRecoveryCommand>
 18{
 3519    public PasswordRecoveryCommandValidator()
 20    {
 3521        RuleFor(command => command.Email)
 3522            .NotEmpty().WithMessage(AuthMessages.EmailRequired)
 3523            .EmailAddress().WithMessage(AuthMessages.EmailInvalid);
 3524    }
 25}

Methods/Properties

.ctor()