TestingHelper.Test.Ps1

param (
    [switch] $Verbose
)
 
 
Remove-Module -Name TestingHelper -ErrorAction SilentlyContinue ; Import-Module -Name TestingHelper
 
function Test-TestingHelper_Assert
{
    [CmdletBinding()]
    param ()
 
    Write-Verbose -Message "Test-TestingHelper_Assert..."
 
    Assert -Condition $true
    Assert -Condition $true -Expected $true
    Assert -Condition $false -Expected $false
 
    try {
        Assert -Condition $false
        throw "We should had failed on Assert False"
    } catch {
        Write-Verbose -Message "Did throw"
    }
     
    try {
        Assert -Condition $true -Expected $false
        throw "We should had failed on Assert true expected false"
    } catch {
        Write-Verbose -Message "Did throw"
    }
 
}
 
function Test-TestingHelper_IsFalse
{
    [CmdletBinding()] param ()
 
    IsFalse -Condition $false
    try {
        Isfalse -Condition $true
        throw "We should had failed on Assert true expected false"
    } catch {
        Write-Verbose -Message "Did throw"
    }
}
 
function Test-TestingHelper_IsTrue
{
    [CmdletBinding()] param ()
 
    IsTrue -Condition $true
 
    try {
        IsTrue -Condition $false
        throw "We should had failed on Assert false expected true"
    } catch {
        Write-Verbose -Message "Did throw"
    }
}
 
#Start-TestFunction -FunctionName Test-TestingHelper_Assert -Verbose
Start-Test -Prefix Test-TestingHelper_ -Verbose:$Verbose