< Summary

Information
Class: RoleRadar.Domain.Tracking.PostingSignal
Assembly: RoleRadar.Domain
File(s): /home/runner/work/roleradar/roleradar/src/RoleRadar.Domain/Tracking/PostingSignal.cs
Line coverage
100%
Covered lines: 36
Uncovered lines: 0
Coverable lines: 36
Total lines: 65
Line coverage: 100%
Branch coverage
100%
Covered branches: 16
Total branches: 16
Branch coverage: 100%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
get_Id()100%11100%
get_OwnerId()100%11100%
get_PostingId()100%11100%
get_SignalType()100%11100%
get_Evidence()100%11100%
get_ObservedAt()100%11100%
get_DeadlineDate()100%11100%
.ctor(...)100%1616100%

File(s)

/home/runner/work/roleradar/roleradar/src/RoleRadar.Domain/Tracking/PostingSignal.cs

#LineLine coverage
 1namespace RoleRadar.Domain.Tracking;
 2
 3public sealed record PostingSignal
 4{
 5    public const int MaxEvidenceLength = 500;
 6
 3367    public Guid Id { get; init; }
 3368    public string OwnerId { get; init; }
 4689    public Guid PostingId { get; init; }
 49210    public SignalType SignalType { get; init; }
 35811    public string Evidence { get; init; }
 34012    public DateTimeOffset ObservedAt { get; init; }
 41413    public string? DeadlineDate { get; init; }
 14
 25615    public PostingSignal(
 25616        Guid id,
 25617        string ownerId,
 25618        Guid postingId,
 25619        SignalType signalType,
 25620        string evidence,
 25621        DateTimeOffset observedAt,
 25622        string? deadlineDate = null)
 23    {
 25624        if (id == Guid.Empty)
 25        {
 226            throw new ArgumentException("Signal identifier cannot be empty.", nameof(id));
 27        }
 28
 25429        if (string.IsNullOrWhiteSpace(ownerId))
 30        {
 431            throw new ArgumentException("Owner identifier cannot be null or whitespace.", nameof(ownerId));
 32        }
 33
 25034        if (postingId == Guid.Empty)
 35        {
 236            throw new ArgumentException("Posting identifier cannot be empty.", nameof(postingId));
 37        }
 38
 24839        if (string.IsNullOrWhiteSpace(evidence))
 40        {
 441            throw new ArgumentException("Evidence cannot be null or whitespace.", nameof(evidence));
 42        }
 43
 24444        if (evidence.Length > MaxEvidenceLength)
 45        {
 246            throw new ArgumentException($"Evidence cannot exceed {MaxEvidenceLength} characters.", nameof(evidence));
 47        }
 48
 24249        if (!string.IsNullOrWhiteSpace(deadlineDate))
 50        {
 6051            if (!DateOnly.TryParseExact(deadlineDate.Trim(), "yyyy-MM-dd", System.Globalization.CultureInfo.InvariantCul
 52            {
 253                throw new ArgumentException("Deadline date must be in YYYY-MM-DD format.", nameof(deadlineDate));
 54            }
 55        }
 56
 24057        Id = id;
 24058        OwnerId = ownerId.Trim();
 24059        PostingId = postingId;
 24060        SignalType = signalType;
 24061        Evidence = evidence.Trim();
 24062        ObservedAt = observedAt;
 24063        DeadlineDate = string.IsNullOrWhiteSpace(deadlineDate) ? null : deadlineDate.Trim();
 24064    }
 65}