30 lines
973 B
PowerShell
30 lines
973 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-AlkamiFabServers" {
|
|
|
|
Context "Server Filter" {
|
|
|
|
$servers = @("FAB1", "FAB2", "BadFAB123", "ALK-PLA1-QA4", "MIC1", "APP1", "WEB1", "ALK-PLA1-QW4")
|
|
|
|
It "Filters Fab Servers" {
|
|
$filtered = Select-AlkamiFabServers -Servers $servers
|
|
$filtered | Should -Be @("FAB1", "FAB2")
|
|
}
|
|
|
|
It "Handles Empty Collection" {
|
|
$result = Select-AlkamiFabServers -Servers @()
|
|
$result | Should -Be $null
|
|
}
|
|
|
|
It "Handles Null" {
|
|
$result = Select-AlkamiFabServers -Servers $null
|
|
$result | Should -Be $null
|
|
}
|
|
}
|
|
} |