< Summary

Information
Class: RoleRadar.Application.Integrity.IntegrityAnomalyDto
Assembly: RoleRadar.Application
File(s): /home/runner/work/roleradar/roleradar/src/RoleRadar.Application/Integrity/VerifyIntegrityQuery.cs
Line coverage
0%
Covered lines: 0
Uncovered lines: 5
Coverable lines: 5
Total lines: 36
Line coverage: 0%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
.ctor(...)100%210%
get_Kind()100%210%
get_Description()100%210%
get_SourceId()100%210%
get_TargetId()100%210%

File(s)

/home/runner/work/roleradar/roleradar/src/RoleRadar.Application/Integrity/VerifyIntegrityQuery.cs

#LineLine coverage
 1using RoleRadar.Application.Abstractions;
 2
 3namespace RoleRadar.Application.Integrity;
 4
 05public sealed record IntegrityAnomalyDto(
 06    string Kind,
 07    string Description,
 08    Guid SourceId,
 09    Guid? TargetId = null);
 10
 11public sealed record VerifyIntegrityResultDto(
 12    int AnomalyCount,
 13    IReadOnlyList<IntegrityAnomalyDto> Anomalies);
 14
 15public sealed record VerifyIntegrityQuery(string? OwnerId = null) : IQuery<VerifyIntegrityResultDto>;
 16
 17public interface IIntegrityRepository
 18{
 19    Task<Result<VerifyIntegrityResultDto>> VerifyIntegrityAsync(string? ownerId = null, CancellationToken cancellationTo
 20}
 21
 22public sealed class VerifyIntegrityQueryHandler : IQueryHandler<VerifyIntegrityQuery, VerifyIntegrityResultDto>
 23{
 24    private readonly IIntegrityRepository _integrityRepository;
 25
 26    public VerifyIntegrityQueryHandler(IIntegrityRepository integrityRepository)
 27    {
 28        _integrityRepository = integrityRepository ?? throw new ArgumentNullException(nameof(integrityRepository));
 29    }
 30
 31    public Task<Result<VerifyIntegrityResultDto>> HandleAsync(VerifyIntegrityQuery query, CancellationToken cancellation
 32    {
 33        ArgumentNullException.ThrowIfNull(query);
 34        return _integrityRepository.VerifyIntegrityAsync(query.OwnerId, cancellationToken);
 35    }
 36}