< Summary - Kestrun — Combined Coverage

Information
Class: Kestrun.Razor.PwshKestrunModel
Assembly: Kestrun
File(s): /home/runner/work/Kestrun/Kestrun/src/CSharp/Kestrun/Razor/PowerShellPageModel.cs
Tag: Kestrun/Kestrun@9d3a582b2d63930269564a7591aa77ef297cadeb
Line coverage
100%
Covered lines: 3
Uncovered lines: 0
Coverable lines: 3
Total lines: 30
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

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
get_Data()100%11100%
Query(...)100%11100%
get_Config()100%11100%

File(s)

/home/runner/work/Kestrun/Kestrun/src/CSharp/Kestrun/Razor/PowerShellPageModel.cs

#LineLine coverage
 1using Microsoft.AspNetCore.Mvc.RazorPages;
 2
 3namespace Kestrun.Razor;
 4
 5/// <summary>
 6/// Base PageModel that exposes whatever the sibling PowerShell script placed
 7/// in <c>HttpContext.Items["PageModel"]</c>.
 8/// </summary>
 9public class PwshKestrunModel : PageModel
 10{
 11    /// <summary>
 12    /// Gets the dynamic data object placed in <c>HttpContext.Items["PageModel"]</c> by the sibling PowerShell script.
 13    /// </summary>
 114    public dynamic? Data => HttpContext.Items["PageModel"];
 15
 16    // convenience helpers ----------------------------------------------
 17
 18    /// <summary>
 19    /// Gets the value of a query string parameter by key from the current HTTP request.
 20    /// </summary>
 21    /// <param name="key">The query string key.</param>
 22    /// <returns>The value associated with the specified key, or null if not found.</returns>
 223    public string? Query(string key) => HttpContext.Request.Query[key];
 24
 25    /// <summary>
 26    /// Gets the application configuration from the current HTTP request's service provider.
 27    /// </summary>
 28    public IConfiguration Config =>
 129        HttpContext.RequestServices.GetRequiredService<IConfiguration>();
 30}