< Summary - Kestrun — Combined Coverage

Information
Class: Kestrun.Callback.CallbackRequest
Assembly: Kestrun
File(s): /home/runner/work/Kestrun/Kestrun/src/CSharp/Kestrun/Callback/CallbackRequest.cs
Tag: Kestrun/Kestrun@ca54e35c77799b76774b3805b6f075cdbc0c5fbe
Line coverage
100%
Covered lines: 38
Uncovered lines: 0
Coverable lines: 38
Total lines: 105
Line coverage: 100%
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

Coverage history

Coverage history 0 25 50 75 100 01/02/2026 - 00:16:25 Line coverage: 100% (38/38) Total lines: 105 Tag: Kestrun/Kestrun@8405dc23b786b9d436fba0d65fb80baa4171e1d0

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
get_CallbackId()100%11100%
get_OperationId()100%11100%
get_TargetUrl()100%11100%
get_HttpMethod()100%11100%
get_Headers()100%11100%
get_ContentType()100%11100%
get_Body()100%11100%
get_CorrelationId()100%11100%
get_IdempotencyKey()100%11100%
get_Attempt()100%11100%
get_CreatedAt()100%11100%
get_NextAttemptAt()100%11100%
get_Timeout()100%11100%
.ctor(...)100%11100%

File(s)

/home/runner/work/Kestrun/Kestrun/src/CSharp/Kestrun/Callback/CallbackRequest.cs

#LineLine coverage
 1namespace Kestrun.Callback;
 2
 3/// <summary>
 4/// Represents a request to perform a callback operation.
 5/// </summary>
 6public class CallbackRequest
 7{
 8    /// <summary>
 9    /// Stable id for tracking
 10    /// </summary>
 411    public string CallbackId { get; }              // stable id for tracking
 12
 13    /// <summary>
 14    /// E.g. createPayment
 15    /// </summary>
 2916    public string OperationId { get; set; }             // e.g. createPayment
 17    /// <summary>
 18    /// The URL to which the callback request will be sent
 19    /// </summary>
 3720    public Uri TargetUrl { get; set; }
 21    /// <summary>
 22    /// HTTP method to use for the callback (e.g., POST, PUT)
 23    /// </summary>
 724    public string HttpMethod { get; }              // POST, PUT, etc.
 25    /// <summary>
 26    /// HTTP headers to include in the callback request
 27    /// </summary>
 3628    public IDictionary<string, string> Headers { get; set; }
 29    /// <summary>
 30    /// The content type of the callback request body
 31    /// </summary>
 532    public string ContentType { get; }
 33    /// <summary>
 34    /// The body of the callback request
 35    /// </summary>
 3936    public byte[]? Body { get; set; }
 37    /// <summary>
 38    /// Trace or correlation identifier
 39    /// </summary>
 3440    public string CorrelationId { get; set; }           // trace/correlation
 41
 42    /// <summary>
 43    /// Key for receiver deduplication
 44    /// </summary>
 3545    public string IdempotencyKey { get; set; }          // for receiver dedupe
 46    /// <summary>
 47    /// Attempt number, starting at 0
 48    /// </summary>
 5149    public int Attempt { get; set; }                    // starts at 0
 50    /// <summary>
 51    /// Timestamp when the callback request was created
 52    /// </summary>
 3053    public DateTimeOffset CreatedAt { get; }
 54    /// <summary>
 55    /// Timestamp for the next attempt
 56    /// </summary>
 4157    public DateTimeOffset NextAttemptAt { get; set; }
 58    /// <summary>
 59    /// Timeout duration for the callback request
 60    /// </summary>
 3461    public TimeSpan Timeout { get; set; }
 62
 63    /// <summary>
 64    /// Initializes a new instance of the <see cref="CallbackRequest"/> class.
 65    /// </summary>
 66    /// <param name="callbackId"> </param>
 67    /// <param name="operationId"></param>
 68    /// <param name="targetUrl"></param>
 69    /// <param name="httpMethod"></param>
 70    /// <param name="headers"></param>
 71    /// <param name="contentType"></param>
 72    /// <param name="body"></param>
 73    /// <param name="correlationId"></param>
 74    /// <param name="idempotencyKey"></param>
 75    /// <param name="timeout"></param>
 2876    public CallbackRequest(
 2877       string callbackId,
 2878       string operationId,
 2879       Uri targetUrl,
 2880       string httpMethod,
 2881       IDictionary<string, string> headers,
 2882       string contentType,
 2883       byte[]? body,
 2884       string correlationId,
 2885       string idempotencyKey,
 2886       TimeSpan timeout)
 87    {
 2888        CallbackId = callbackId;
 2889        OperationId = operationId;
 2890        TargetUrl = targetUrl;
 2891        HttpMethod = httpMethod;
 92
 2893        Headers = headers;
 2894        ContentType = contentType;
 2895        Body = body;
 96
 2897        CorrelationId = correlationId;
 2898        IdempotencyKey = idempotencyKey;
 99
 28100        Attempt = 0;
 28101        CreatedAt = DateTimeOffset.UtcNow;
 28102        NextAttemptAt = CreatedAt;
 28103        Timeout = timeout;
 28104    }
 105}