< Summary - Kestrun — Combined Coverage

Information
Class: Kestrun.Hosting.Options.MapRouteOptions
Assembly: Kestrun
File(s): /home/runner/work/Kestrun/Kestrun/src/CSharp/Kestrun/Hosting/Options/MapRouteOptions.cs
Tag: Kestrun/Kestrun@2d87023b37eb91155071c91dd3d6a2eeb3004705
Line coverage
100%
Covered lines: 15
Uncovered lines: 0
Coverable lines: 15
Total lines: 72
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 08/26/2025 - 01:25:22 Line coverage: 100% (22/22) Total lines: 110 Tag: Kestrun/Kestrun@07f821172e5dc3657f1be7e6818f18d6721cf38a10/13/2025 - 16:52:37 Line coverage: 100% (15/15) Total lines: 72 Tag: Kestrun/Kestrun@10d476bee71c71ad215bb8ab59f219887b5b4a5e

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
get_Pattern()100%11100%
get_HttpVerbs()100%11100%
get_RequireSchemes()100%11100%
get_RequirePolicies()100%11100%
get_CorsPolicyName()100%11100%
get_ShortCircuit()100%11100%
get_ShortCircuitStatusCode()100%11100%
get_AllowAnonymous()100%11100%
get_DisableAntiforgery()100%11100%
get_DisableResponseCompression()100%11100%
get_RateLimitPolicyName()100%11100%
get_Endpoints()100%11100%
get_OpenAPI()100%11100%
get_ScriptCode()100%11100%
get_ThrowOnDuplicate()100%11100%

File(s)

/home/runner/work/Kestrun/Kestrun/src/CSharp/Kestrun/Hosting/Options/MapRouteOptions.cs

#LineLine coverage
 1using Kestrun.Utilities;
 2
 3namespace Kestrun.Hosting.Options;
 4/// <summary>
 5/// Options for mapping a route, including pattern, HTTP verbs, script code, authorization, and metadata.
 6/// </summary>
 7public record MapRouteOptions
 8{
 9    /// <summary>
 10    /// The route pattern to match for this option.
 11    /// </summary>
 48212    public string? Pattern { get; set; }
 13    /// <summary>
 14    /// The HTTP verbs (methods) that this route responds to.
 15    /// </summary>
 33416    public List<HttpVerb> HttpVerbs { get; set; } = [];
 17    /// <summary>
 18    /// Authorization Scheme names required for this route.
 19    /// </summary>
 13420    public string[] RequireSchemes { get; set; } = []; // Authorization scheme name, if any
 21    /// <summary>
 22    /// Authorization policy names required for this route.
 23    /// </summary>
 11924    public string[]? RequirePolicies { get; set; } = []; // Authorization policies, if any
 25    /// <summary>
 26    /// Name of the CORS policy to apply, if any.
 27    /// </summary>
 10928    public string CorsPolicyName { get; set; } = string.Empty; // Name of the CORS policy to apply, if any
 29    /// <summary>
 30    /// If true, short-circuits the pipeline after this route.
 31    /// </summary>
 3932    public bool ShortCircuit { get; set; } // If true, short-circuit the pipeline after this route
 33    /// <summary>
 34    /// Status code to return if short-circuiting the pipeline after this route.
 35    /// </summary>
 436    public int? ShortCircuitStatusCode { get; set; } = null; // Status code to return if short-circuiting
 37    /// <summary>
 38    /// If true, allows anonymous access to this route.
 39    /// </summary>
 3740    public bool AllowAnonymous { get; set; }
 41    /// <summary>
 42    /// If true, disables antiforgery protection for this route.
 43    /// </summary>
 6244    public bool DisableAntiforgery { get; set; }
 45    /// <summary>
 46    /// If true, disables response compression for this route.
 47    /// </summary>
 4148    public bool DisableResponseCompression { get; set; }
 49    /// <summary>
 50    /// The name of the rate limit policy to apply to this route, if any.
 51    /// </summary>
 3852    public string? RateLimitPolicyName { get; set; }
 53
 54    /// <summary>
 55    /// Endpoints to bind the route to, if any.
 56    /// </summary>
 12557    public string[]? Endpoints { get; set; } = [];
 58
 59    /// <summary>
 60    /// OpenAPI metadata for this route.
 61    /// </summary>
 24062    public OpenAPIMetadata OpenAPI { get; set; } = new OpenAPIMetadata(); // OpenAPI metadata for this route
 63
 64    /// <summary>
 65    /// Script code and language options for this route.
 66    /// </summary>
 29167    public LanguageOptions ScriptCode { get; init; } = new LanguageOptions();
 68    /// <summary>
 69    /// If true, throws an exception on duplicate routes.
 70    /// </summary>
 871    public bool ThrowOnDuplicate { get; set; }
 72}