Pester 5 Prep
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user