30 lines
981 B
PowerShell
30 lines
981 B
PowerShell
|
. $PSScriptRoot\..\..\Load-PesterModules.ps1
|
|||
|
$here = Split-Path -Parent $MyInvocation.MyCommand.Path
|
|||
|
$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path) -replace '\.tests\.', '.'
|
|||
|
$functionPath = Join-Path -Path $here -ChildPath $sut
|
|||
|
Write-Host "Overriding SUT: $functionPath"
|
|||
|
Import-Module $functionPath -Force
|
|||
|
$moduleForMock = ""
|
|||
|
|
|||
|
Describe "Select-AlkamiWebServers" {
|
|||
|
|
|||
|
Context "Server Filter" {
|
|||
|
|
|||
|
$servers = @("WEB1", "WEB2", "ALK-PLA1-QW4", "BadWEB1234", "MIC1", "FAB1", "APP1", "ALK-PLA1-QM4")
|
|||
|
|
|||
|
It "Filters Web Servers" {
|
|||
|
$filtered = Select-AlkamiWebServers $servers
|
|||
|
$filtered | Should -Be @("WEB1", "WEB2", "ALK-PLA1-QW4")
|
|||
|
}
|
|||
|
|
|||
|
It "Handles Empty Collection" {
|
|||
|
$result = Select-AlkamiWebServers -Servers @()
|
|||
|
$result | Should -Be $null
|
|||
|
}
|
|||
|
|
|||
|
It "Handles Null" {
|
|||
|
$result = Select-AlkamiWebServers -Servers $null
|
|||
|
$result | Should -Be $null
|
|||
|
}
|
|||
|
}
|
|||
|
}
|