< 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@9d3a582b2d63930269564a7591aa77ef297cadeb
Line coverage
94%
Covered lines: 18
Uncovered lines: 1
Coverable lines: 19
Total lines: 81
Line coverage: 94.7%
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

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
get_ServerOptions()100%11100%
get_ServerLimits()100%210%
get_ApplicationName()100%11100%
get_MaxRunspaces()100%11100%
get_MinRunspaces()100%11100%
get_MaxSchedulerRunspaces()100%11100%
get_Listeners()100%11100%
get_HttpsConnectionAdapter()100%11100%
get_ListenUnixSockets()100%11100%
get_NamedPipeNames()100%11100%
get_NamedPipeOptions()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;
 4namespace Kestrun.Hosting.Options;
 5
 6/// <summary>
 7/// Simple options class for configuring Kestrel server settings.
 8/// </summary>
 9/// <remarks>
 10/// This class provides a strongly-typed alternative to using a hashtable for Kestrel server options.
 11/// </remarks>
 12public class KestrunOptions
 13{
 14    /// <summary>
 15    /// Gets or sets the Kestrel server options.
 16    /// </summary>
 29817    public KestrelServerOptions ServerOptions { get; set; }
 18
 19    /// <summary>Provides access to request limit options. Use a hashtable or a KestrelServerLimits instance.</summary>
 020    public KestrelServerLimits ServerLimits => ServerOptions.Limits;
 21
 22    /// <summary>Application name (optional, for diagnostics).</summary>
 14323    public string? ApplicationName { get; set; }
 24
 25    /// <summary>
 26    /// Gets or sets the maximum number of runspaces to use for script execution.
 27    /// </summary>
 2228    public int? MaxRunspaces { get; set; }
 29
 30    /// <summary>
 31    /// Gets or sets the minimum number of runspaces to use for script execution.
 32    /// Defaults to 1.
 33    /// </summary>
 29934    public int MinRunspaces { get; set; }
 35
 36    /// <summary>
 37    /// Gets or sets the maximum number of runspaces to use for the scheduler service.
 38    /// Defaults to 8.
 39    /// </summary>
 28040    public int MaxSchedulerRunspaces { get; set; }
 41
 42    /// <summary>
 43    /// List of configured listeners for the Kestrel server.
 44    /// Each listener can be configured with its own IP address, port, protocols, and other options.
 45    /// </summary>
 4646    public List<ListenerOptions> Listeners { get; }
 47
 48    /// <summary>
 49    /// Gets the HTTPS connection adapter options.
 50    /// </summary>
 2251    public HttpsConnectionAdapterOptions? HttpsConnectionAdapter { get; set; }
 52
 53    /// <summary>
 54    /// Optional path to a Unix domain socket for Kestrel to listen on.
 55    /// </summary>
 2256    public List<string> ListenUnixSockets { get; }
 57
 58    /// <summary>
 59    /// Optional name of a Named Pipe for Kestrel to listen on.
 60    /// </summary>
 2261    public List<string> NamedPipeNames { get; }
 62
 63    /// <summary>
 64    /// Gets or sets the Named Pipe transport options.
 65    /// </summary>
 2266    public NamedPipeTransportOptions? NamedPipeOptions { get; set; }
 67
 68    /// <summary>
 69    /// Initializes a new instance of the <see cref="KestrunOptions"/> class with default values.
 70    /// </summary>
 27671    public KestrunOptions()
 72    {
 73        // Set default values if needed
 27674        MinRunspaces = 1; // Default to 1 runspace
 27675        Listeners = [];
 27676        ServerOptions = new KestrelServerOptions();
 27677        MaxSchedulerRunspaces = 8; // Default max scheduler runspaces
 27678        ListenUnixSockets = [];
 27679        NamedPipeNames = [];
 27680    }
 81}