58 lines
1.7 KiB
PowerShell
58 lines
1.7 KiB
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 "Test-AlkamiLegacyUtilityManifest10" {
|
|
Context "Test valid manifest" {
|
|
$result = Test-AlkamiLegacyUtilityManifest10 @{
|
|
needsShared = $true
|
|
}
|
|
|
|
It "Tested successfully" {
|
|
$result.success | Should -BeTrue
|
|
}
|
|
|
|
It "Produced no error messages" {
|
|
$result.results.Count | Should -Be 0
|
|
}
|
|
}
|
|
|
|
Context "Test valid manifest" {
|
|
$result = Test-AlkamiLegacyUtilityManifest10 @{
|
|
# This is valid and represents the lack of a value, but we have to give something to the object for parsing
|
|
# At runtime it will have a node element available and just won't process because the value doesn't have the child
|
|
needsShared = ''
|
|
}
|
|
|
|
It "Tested successfully" {
|
|
$result | Should -BeTrue
|
|
}
|
|
|
|
It "Produced no error messages" {
|
|
$result.results.Count | Should -Be 0
|
|
}
|
|
}
|
|
|
|
Context "Test invalid manifest" {
|
|
$result = Test-AlkamiLegacyUtilityManifest10 @{
|
|
needsShared = 'garbage'
|
|
}
|
|
|
|
It "Tested successfully" {
|
|
$result.success | Should -BeFalse
|
|
}
|
|
|
|
It "Actually produced warnings" {
|
|
$result.results | Should -Not -BeNullOrEmpty
|
|
}
|
|
|
|
It "Produced at least one warning statements" {
|
|
$result.results.Count | Should -BeGreaterOrEqual 1
|
|
}
|
|
}
|
|
}
|