< Summary

Information
Class: AsiBackbone.Samples.NcatAuditCompletionAdapter.NcatAuditCompletionAdapterOptions
Assembly: AsiBackbone.Samples.NcatAuditCompletionAdapter
File(s): /home/runner/work/AsiBackbone/AsiBackbone/samples/NcatAuditCompletionAdapter/NcatAuditCompletionAdapterOptions.cs
Line coverage
55%
Covered lines: 5
Uncovered lines: 4
Coverable lines: 9
Total lines: 34
Line coverage: 55.5%
Branch coverage
75%
Covered branches: 3
Total branches: 4
Branch coverage: 75%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
get_PersistenceProvider()100%11100%
get_DeadLetterAfterAttempts()100%11100%
Validate()75%7442.85%

File(s)

/home/runner/work/AsiBackbone/AsiBackbone/samples/NcatAuditCompletionAdapter/NcatAuditCompletionAdapterOptions.cs

#LineLine coverage
 1namespace AsiBackbone.Samples.NcatAuditCompletionAdapter;
 2
 3/// <summary>
 4/// Configures source-side delivery behavior for the optional NCAT audit-completion adapter.
 5/// </summary>
 6public sealed record NcatAuditCompletionAdapterOptions
 7{
 8    /// <summary>
 9    /// Gets the provider label placed in the governed execution receipt.
 10    /// </summary>
 7611    public string PersistenceProvider { get; init; } = "NCAT";
 12
 13    /// <summary>
 14    /// Gets the optional attempt number at which a persistence failure is returned as dead-lettered.
 15    /// </summary>
 16    /// <remarks>
 17    /// A <see langword="null" /> value keeps lifecycle persistence failures retryable indefinitely.
 18    /// The source completion entry is never acknowledged as delivered for retryable or dead-letter results.
 19    /// </remarks>
 3420    public int? DeadLetterAfterAttempts { get; init; }
 21
 22    internal void Validate()
 23    {
 2824        ArgumentException.ThrowIfNullOrWhiteSpace(PersistenceProvider);
 25
 2826        if (DeadLetterAfterAttempts is < 1)
 27        {
 028            throw new ArgumentOutOfRangeException(
 029                nameof(DeadLetterAfterAttempts),
 030                DeadLetterAfterAttempts,
 031                "Dead-letter attempt threshold must be at least one when configured.");
 32        }
 2833    }
 34}