< Summary

Information
Class: AsiBackbone.Samples.NcatAuditCompletionAdapter.NcatAuditCompletionAdapterOptions
Assembly: AsiBackbone.Samples.NcatAuditCompletionAdapter
File(s): /home/runner/work/AsiBackbone/AsiBackbone/samples/NcatAuditCompletionAdapter/NcatAuditCompletionAdapterOptions.cs
Line coverage
42%
Covered lines: 3
Uncovered lines: 4
Coverable lines: 7
Total lines: 34
Line coverage: 42.8%
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
Validate()75%7442.86%

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>
 11    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>
 20    public int? DeadLetterAfterAttempts { get; init; }
 21
 22    internal void Validate()
 23    {
 2124        ArgumentException.ThrowIfNullOrWhiteSpace(PersistenceProvider);
 25
 2126        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        }
 2133    }
 34}

Methods/Properties

Validate()