< Summary - Heimdall API

Information
Class: ArturRios.Heimdall.Command.Input.Validation.LoginCommandValidator
Assembly: ArturRios.Heimdall.Command
File(s): /home/runner/work/heimdall-api/heimdall-api/src/Application/ArturRios.Heimdall.Command/Input/Validation/LoginCommandValidator.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/LoginCommandValidator.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="LoginCommand" /> (UC-11 AF-11f, NFR-10). Whether the
 8///     credentials are <em>correct</em> is the handler's business, and every wrong answer there is a
 9///     single 401 (AF-11a…AF-11e).
 10/// </summary>
 11/// <remarks>
 12///     Deliberately no minimum password length, unlike the validators that guard person creation: at
 13///     login a short password is a failed attempt, not a malformed request, and answering 400 to it
 14///     would tell a caller their guess was too short to be anyone's password.
 15/// </remarks>
 16public class LoginCommandValidator : AbstractValidator<LoginCommand>
 17{
 11118    public LoginCommandValidator()
 19    {
 11120        RuleFor(command => command.Email)
 11121            .NotEmpty().WithMessage(AuthMessages.EmailRequired)
 11122            .EmailAddress().WithMessage(AuthMessages.EmailInvalid);
 23
 11124        RuleFor(command => command.Password)
 11125            .NotEmpty().WithMessage(AuthMessages.PasswordRequired);
 11126    }
 27}

Methods/Properties

.ctor()