Pester 5 Prep

This commit is contained in:
Wes Carroll
2020-04-11 22:35:23 -04:00
parent 8578c775dd
commit fb45693fb1
54 changed files with 135 additions and 138 deletions
@@ -40,12 +40,12 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' {
It "<TestName> parameter cannot be null or empty" -TestCases $ParameterValidationTestCases {
param($ParameterName)
$thisParameter = $thisCommand.Parameters[$ParameterName]
$thisParameter.Attributes.Where{ $_ -is [ValidateNotNullOrEmpty] }.Count | Should Be 1
$thisParameter.Attributes.Where{ $_ -is [ValidateNotNullOrEmpty] }.Count | Should -Be 1
}
It "Method parameter can only be 'GET', 'POST', 'PUT', 'DELETE'" {
$thisParameter = $thisCommand.Parameters['method']
$thisParameter.Attributes.Where{ $_ -is [ValidateSet] }.Count | Should Be 1
$thisParameter.Attributes.Where{ $_ -is [ValidateSet] }.Count | Should -Be 1
$thisParameter.Attributes.Where{ $_ -is [ValidateSet] }.validValues -contains 'GET' | Should -BeTrue
$thisParameter.Attributes.Where{ $_ -is [ValidateSet] }.validValues -contains 'PUT' | Should -BeTrue
$thisParameter.Attributes.Where{ $_ -is [ValidateSet] }.validValues -contains 'POST' | Should -BeTrue