ps/Modules/Alkami.PowerShell.Common/Public/Select-AlkamiMicServers.tests.ps1

30 lines
989 B
PowerShell
Raw Normal View History

2023-05-30 22:51:22 -07:00
. $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-AlkamiMicServers" {
Context "Server Filter" {
$servers = @("MIC1", "MIC2", "ALK-PLA1-QM4", "BadMIC123", "APP1", "FAB1", "WEB1", "ALK-PLA1-QW4")
It "Filters Mic Servers" {
$filtered = Select-AlkamiMicServers -Servers $servers
$filtered | Should -Be @("MIC1", "MIC2", "ALK-PLA1-QM4")
}
It "Handles Empty Collection" {
$result = Select-AlkamiMicServers -Servers @()
$result | Should -Be $null
}
It "Handles Null" {
$result = Select-AlkamiMicServers -Servers $null
$result | Should -Be $null
}
}
}