< Summary - Heimdall API

Information
Class: ArturRios.Heimdall.Command.Input.Validation.ResetPasswordCommandValidator
Assembly: ArturRios.Heimdall.Command
File(s): /home/runner/work/heimdall-api/heimdall-api/src/Application/ArturRios.Heimdall.Command/Input/Validation/ResetPasswordCommandValidator.cs
Line coverage
100%
Covered lines: 7
Uncovered lines: 0
Coverable lines: 7
Total lines: 27
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/ResetPasswordCommandValidator.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="ResetPasswordCommand" /> (UC-13, AF-13d). Whether the token
 8///     exists, has expired, or has been used is the handler's business (AF-13a…AF-13c).
 9/// </summary>
 10/// <remarks>
 11///     The minimum length is the one UC-06 applies when a person is created: a reset must not be a
 12///     way around the floor that person creation enforces. No maximum is imposed — the password is
 13///     hashed, never stored — and no composition rules are added, since the specification defines
 14///     none.
 15/// </remarks>
 16public class ResetPasswordCommandValidator : AbstractValidator<ResetPasswordCommand>
 17{
 3718    public ResetPasswordCommandValidator()
 19    {
 3720        RuleFor(command => command.Token)
 3721            .NotEmpty().WithMessage(AuthMessages.TokenRequired);
 22
 3723        RuleFor(command => command.NewPassword)
 3724            .NotEmpty().WithMessage(AuthMessages.PasswordRequired)
 3725            .MinimumLength(8).WithMessage(AuthMessages.PasswordTooShort);
 3726    }
 27}

Methods/Properties

.ctor()