tests/Get-DbaAgentJobOutputFile.Tests.ps1

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
$commandname = $MyInvocation.MyCommand.Name.Replace(".ps1","")
Write-Host -Object "Running $PSCommandpath" -ForegroundColor Cyan
. "$PSScriptRoot\constants.ps1"

Describe "$commandname Unit Tests" -Tag 'UnitTests' {
    Context "Input Validation" {
        It 'SqlInstance parameter is empty' {
            { Get-DbaAgentJobOutputFile -SqlInstance '' -WarningAction Stop 3> $null } | Should Throw
        }
        <#
  This takes 15 seconds to timeout for not much reward
  It 'SqlInstance parameter host cannot be found' {
            Mock Connect-SqlInstance { throw System.Data.SqlClient.SqlException }
            { Get-DbaAgentJobOutputFile -SqlInstance 'ABC' -WarningAction Stop 3> $null } | Should Throw
        }
  #>

    }
}