< Summary - Kestrun — Combined Coverage

Information
Class: Kestrun.Hosting.Options.StatusCodeOptions
Assembly: Kestrun
File(s): /home/runner/work/Kestrun/Kestrun/src/CSharp/Kestrun/Hosting/Options/StatusCodeOptions.cs
Tag: Kestrun/Kestrun@2d87023b37eb91155071c91dd3d6a2eeb3004705
Line coverage
100%
Covered lines: 12
Uncovered lines: 0
Coverable lines: 12
Total lines: 66
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 10/13/2025 - 16:52:37 Line coverage: 100% (12/12) Total lines: 66 Tag: Kestrun/Kestrun@10d476bee71c71ad215bb8ab59f219887b5b4a5e

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
.ctor(...)100%11100%
get_Host()100%11100%
get_ContentType()100%11100%
get_BodyFormat()100%11100%
get_LanguageOptions()100%11100%
get_Options()100%11100%
get_LocationFormat()100%11100%
get_PathFormat()100%11100%
get_QueryFormat()100%11100%

File(s)

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

#LineLine coverage
 1namespace Kestrun.Hosting.Options;
 2
 3/// <summary>
 4/// Options for configuring status code pages middleware.
 5/// </summary>
 6public class StatusCodeOptions
 7{
 8    /// <summary>
 9    /// Initializes a new instance of the <see cref="StatusCodeOptions"/> class.
 10    /// </summary>
 11    /// <param name="host">The KestrunHost instance associated with these options.</param>
 1712    public StatusCodeOptions(KestrunHost host)
 13    {
 1714        ArgumentNullException.ThrowIfNull(host);
 1615        Host = host;
 1616    }
 17    /// <summary>
 18    /// Gets the KestrunHost instance associated with these options.
 19    /// </summary>
 320    public KestrunHost Host { get; }
 21    /// <summary>
 22    /// Gets or sets the content type for the status code response. Default is "text/plain".
 23    /// </summary>
 824    public string? ContentType { get; init; }
 25
 26    /// <summary>
 27    /// Gets or sets the body format string for the status code response. Default is "Status Code: {0}".
 28    /// The format string should contain a single placeholder for the status code.
 29    /// </summary>
 630    public string? BodyFormat { get; init; }
 31
 32    /// <summary>
 33    /// Gets or sets the script options to execute for generating the status code response.
 34    /// If set, this script will be executed instead of using the BodyFormat.
 35    /// </summary>
 636    public LanguageOptions? LanguageOptions { get; init; }
 37
 38
 39    /// <summary>
 40    /// Gets or sets the underlying StatusCodePagesOptions to configure the status code pages middleware.
 41    /// </summary>
 1342    public StatusCodePagesOptions? Options { get; init; }
 43
 44    /// <summary>
 45    /// Gets or sets the location format string for the status code response. If set, the middleware will issue a redire
 46    /// The format string should contain a single placeholder for the status code.
 47    /// If both LocationFormat and PathFormat are set, LocationFormat takes precedence.
 48    /// If neither is set, no redirect will be issued.
 49    /// </summary>
 1450    public string? LocationFormat { get; init; }
 51
 52    /// <summary>
 53    /// Gets or sets the path format string for the status code response. If set, the middleware will re-execute the req
 54    /// The format string should contain a single placeholder for the status code.
 55    /// If both LocationFormat and PathFormat are set, LocationFormat takes precedence.
 56    /// If neither is set, no re-execution will be performed.
 57    /// </summary>
 1358    public string? PathFormat { get; init; }
 59
 60    /// <summary>
 61    /// Gets or sets the query format string for the status code response. If set, the middleware will append the specif
 62    /// The format string should contain a single placeholder for the status code.
 63    /// This is only used if PathFormat is also set.
 64    /// </summary>
 565    public string? QueryFormat { get; init; }
 66}