< Summary - Heimdall API

Information
Class: ArturRios.Heimdall.Command.Input.Validation.UpdateScopePermissionCommandValidator
Assembly: ArturRios.Heimdall.Command
File(s): /home/runner/work/heimdall-api/heimdall-api/src/Application/ArturRios.Heimdall.Command/Input/Validation/UpdateScopePermissionCommandValidator.cs
Line coverage
100%
Covered lines: 7
Uncovered lines: 0
Coverable lines: 7
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/UpdateScopePermissionCommandValidator.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="UpdateScopePermissionCommand" /> (UC-33 main flow step 2).
 8///     The messages are UC-31's: the two use cases reject the same shapes, and UC-33 defines no
 9///     alternative flow of its own for invalid input. Permission existence and actor authorization
 10///     are enforced by the handler. A <c>null</c> description is valid: FluentValidation's
 11///     <c>MaximumLength</c> rule skips <c>null</c> arguments, so only a non-null overlong description
 12///     is rejected.
 13/// </summary>
 14public class UpdateScopePermissionCommandValidator : AbstractValidator<UpdateScopePermissionCommand>
 15{
 1616    public UpdateScopePermissionCommandValidator()
 17    {
 1618        RuleFor(command => command.Name)
 1619            .NotEmpty().WithMessage(ScopePermissionMessages.NameRequired)
 1620            .MaximumLength(200).WithMessage(ScopePermissionMessages.NameTooLong);
 21
 1622        RuleFor(command => command.Description)
 1623            .MaximumLength(500).WithMessage(ScopePermissionMessages.DescriptionTooLong);
 1624    }
 25}

Methods/Properties

.ctor()