src/Cmdlets/New-LineCoverage.psm1

using namespace System.Diagnostics.CodeAnalysis
using module ../LineCoverage.psm1
using module ../LineData.psm1

<#
.SYNOPSIS
    Creates a new line coverage.
.OUTPUTS
    The newly created line coverage.
#>

function New-LineCoverage {
    [CmdletBinding()]
    [OutputType([LineCoverage])]
    [SuppressMessage("PSUseOutputTypeCorrectly", "")]
    param (
        # The coverage data.
        [ValidateNotNull()]
        [LineData[]] $Data = @(),

        # The number of lines found.
        [ValidateRange("NonNegative")]
        [int] $Found,

        # The number of lines hit.
        [ValidateRange("NonNegative")]
        [int] $Hit
    )

    [LineCoverage]@{
        Data = $Data
        Found = $Found
        Hit = $Hit
    }
}