< Summary - Kestrun — Combined Coverage

Information
Class: Kestrun.Hosting.Options.KestrunOptions
Assembly: Kestrun
File(s): /home/runner/work/Kestrun/Kestrun/src/CSharp/Kestrun/Hosting/Options/KestrunOptions.cs
Tag: Kestrun/Kestrun@ca54e35c77799b76774b3805b6f075cdbc0c5fbe
Line coverage
100%
Covered lines: 22
Uncovered lines: 0
Coverable lines: 22
Total lines: 98
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 09/08/2025 - 20:34:03 Line coverage: 94.7% (18/19) Total lines: 81 Tag: Kestrun/Kestrun@3790ee5884494a7a2a829344a47743e0bf492e7210/13/2025 - 16:52:37 Line coverage: 100% (21/21) Total lines: 88 Tag: Kestrun/Kestrun@10d476bee71c71ad215bb8ab59f219887b5b4a5e01/17/2026 - 04:33:35 Line coverage: 100% (22/22) Total lines: 98 Tag: Kestrun/Kestrun@aca34ea8d284564e2f9f6616dc937668dce926ba

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
get_ServerOptions()100%11100%
get_ServerLimits()100%11100%
get_ApplicationName()100%11100%
get_MaxRunspaces()100%11100%
get_MinRunspaces()100%11100%
get_MaxSchedulerRunspaces()100%11100%
get_Health()100%11100%
get_Listeners()100%11100%
get_HttpsConnectionAdapter()100%11100%
get_ListenUnixSockets()100%11100%
get_NamedPipeNames()100%11100%
get_NamedPipeOptions()100%11100%
get_DefaultResponseMediaType()100%11100%
.ctor()100%11100%

File(s)

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

#LineLine coverage
 1using Microsoft.AspNetCore.Server.Kestrel.Core;
 2using Microsoft.AspNetCore.Server.Kestrel.Https;
 3using Microsoft.AspNetCore.Server.Kestrel.Transport.NamedPipes;
 4using Kestrun.Health;
 5namespace Kestrun.Hosting.Options;
 6
 7/// <summary>
 8/// Simple options class for configuring Kestrel server settings.
 9/// </summary>
 10/// <remarks>
 11/// This class provides a strongly-typed alternative to using a hashtable for Kestrel server options.
 12/// </remarks>
 13public class KestrunOptions
 14{
 15    /// <summary>
 16    /// Default media type value for responses.
 17    /// </summary>
 18    private const string DefaultResponseMediaTypeValue = "text/plain";
 19
 20    /// <summary>
 21    /// Gets or sets the Kestrel server options.
 22    /// </summary>
 131023    public KestrelServerOptions ServerOptions { get; set; }
 24
 25    /// <summary>Provides access to request limit options. Use a hashtable or a KestrelServerLimits instance.</summary>
 226    public KestrelServerLimits ServerLimits => ServerOptions.Limits;
 27
 28    /// <summary>Application name (optional, for diagnostics).</summary>
 62829    public string? ApplicationName { get; set; }
 30
 31    /// <summary>
 32    /// Gets or sets the maximum number of runspaces to use for script execution.
 33    /// </summary>
 6234    public int? MaxRunspaces { get; set; }
 35
 36    /// <summary>
 37    /// Gets or sets the minimum number of runspaces to use for script execution.
 38    /// Defaults to 1.
 39    /// </summary>
 131840    public int MinRunspaces { get; set; }
 41
 42    /// <summary>
 43    /// Gets or sets the maximum number of runspaces to use for the scheduler service.
 44    /// Defaults to 8.
 45    /// </summary>
 125746    public int MaxSchedulerRunspaces { get; set; }
 47
 48    /// <summary>
 49    /// Gets or sets the health endpoint configuration.
 50    /// </summary>
 250851    public HealthEndpointOptions Health { get; set; } = new();
 52
 53    /// <summary>
 54    /// List of configured listeners for the Kestrel server.
 55    /// Each listener can be configured with its own IP address, port, protocols, and other options.
 56    /// </summary>
 11757    public List<ListenerOptions> Listeners { get; }
 58
 59    /// <summary>
 60    /// Gets the HTTPS connection adapter options.
 61    /// </summary>
 5962    public HttpsConnectionAdapterOptions? HttpsConnectionAdapter { get; set; }
 63
 64    /// <summary>
 65    /// Optional path to a Unix domain socket for Kestrel to listen on.
 66    /// </summary>
 6367    public List<string> ListenUnixSockets { get; }
 68
 69    /// <summary>
 70    /// Optional name of a Named Pipe for Kestrel to listen on.
 71    /// </summary>
 6372    public List<string> NamedPipeNames { get; }
 73
 74    /// <summary>
 75    /// Gets or sets the Named Pipe transport options.
 76    /// </summary>
 6177    public NamedPipeTransportOptions? NamedPipeOptions { get; set; }
 78
 79    /// <summary>
 80    /// Gets or sets the default media type to use for responses when no Accept header is provided.
 81    /// </summary>
 125082    public string? DefaultResponseMediaType { get; set; } = DefaultResponseMediaTypeValue;
 83
 84    /// <summary>
 85    /// Initializes a new instance of the <see cref="KestrunOptions"/> class with default values.
 86    /// </summary>
 125087    public KestrunOptions()
 88    {
 89        // Set default values if needed
 125090        MinRunspaces = 1; // Default to 1 runspace
 125091        Listeners = [];
 125092        ServerOptions = new KestrelServerOptions();
 125093        MaxSchedulerRunspaces = 8; // Default max scheduler runspaces
 125094        ListenUnixSockets = [];
 125095        NamedPipeNames = [];
 125096        Health = new HealthEndpointOptions();
 125097    }
 98}