< Summary - Kestrun — Combined Coverage

Information
Class: Kestrun.Hosting.KestrunHostRuntime
Assembly: Kestrun
File(s): /home/runner/work/Kestrun/Kestrun/src/CSharp/Kestrun/Hosting/KestrunHostRuntime.cs
Tag: Kestrun/Kestrun@d9261bd752e45afa789d10bc0c82b7d5724d9589
Line coverage
100%
Covered lines: 9
Uncovered lines: 0
Coverable lines: 9
Total lines: 42
Line coverage: 100%
Branch coverage
83%
Covered branches: 5
Total branches: 6
Branch coverage: 83.3%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Coverage history

Coverage history 0 25 50 75 100 02/05/2026 - 00:28:18 Line coverage: 100% (9/9) Branch coverage: 83.3% (5/6) Total lines: 42 Tag: Kestrun/Kestrun@d9261bd752e45afa789d10bc0c82b7d5724d9589 02/05/2026 - 00:28:18 Line coverage: 100% (9/9) Branch coverage: 83.3% (5/6) Total lines: 42 Tag: Kestrun/Kestrun@d9261bd752e45afa789d10bc0c82b7d5724d9589

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
get_FormOptions()100%11100%
get_FormPartRules()100%11100%
get_StartTime()100%11100%
get_StopTime()100%11100%
get_Uptime()83.33%66100%

File(s)

/home/runner/work/Kestrun/Kestrun/src/CSharp/Kestrun/Hosting/KestrunHostRuntime.cs

#LineLine coverage
 1using Kestrun.Forms;
 2
 3namespace Kestrun.Hosting;
 4/// <summary>
 5/// Represents runtime information for a Kestrun host.
 6/// </summary>
 7
 8public record KestrunHostRuntime
 9{
 10    /// <summary>
 11    /// Gets the form parsing options for Kestrun hosts.
 12    /// </summary>
 63913    public Dictionary<string, KrFormOptions> FormOptions { get; } = new Dictionary<string, KrFormOptions>(StringComparer
 14
 15    /// <summary>
 16    /// Gets the form part rules for Kestrun hosts.
 17    /// </summary>
 67118    public Dictionary<string, KrFormPartRule> FormPartRules { get; } = new Dictionary<string, KrFormPartRule>(StringComp
 19
 20    /// <summary>
 21    /// Gets the timestamp when the Kestrun host was started.
 22    /// </summary>
 2823    public DateTime? StartTime { get; internal set; }
 24
 25    /// <summary>
 26    /// Gets the timestamp when the Kestrun host was stopped.
 27    /// </summary>
 2628    public DateTime? StopTime { get; internal set; }
 29
 30    /// <summary>
 31    /// Gets the uptime duration of the Kestrun host.
 32    /// While running (no StopTime yet), this returns DateTime.UtcNow - StartTime.
 33    /// After stopping, it returns StopTime - StartTime.
 34    /// If StartTime is not set, returns null.
 35    /// </summary>
 36    public TimeSpan? Uptime =>
 337        !StartTime.HasValue
 338            ? null
 339            : StopTime.HasValue
 340                ? StopTime - StartTime
 341                : DateTime.UtcNow - StartTime.Value;
 42}