Add tests for switches
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
#Requires -Modules Pester
|
#Requires -Modules Pester
|
||||||
$global:here = (Split-Path -Parent $PSCommandPath)
|
$global:here = (Split-Path -Parent $PSCommandPath)
|
||||||
$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0]
|
$global:function = ((Split-Path -Leaf $PSCommandPath).Split('.'))[0]
|
||||||
|
|
||||||
Describe $global:function -Tag 'Unit', 'Source', 'Built' {
|
Describe $global:function -Tag 'Unit', 'Source', 'Built' {
|
||||||
BeforeAll {
|
BeforeAll {
|
||||||
@@ -45,6 +45,16 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' {
|
|||||||
{ Connect-ZertoServer -zertoServer -credential 1234 } | Should -Throw
|
{ Connect-ZertoServer -zertoServer -credential 1234 } | Should -Throw
|
||||||
{ Connect-ZertoServer -zertoServer -credential $(@{Username = "zerto\build"; Password = 'SecureString' }) } | Should -Throw
|
{ Connect-ZertoServer -zertoServer -credential $(@{Username = "zerto\build"; Password = 'SecureString' }) } | Should -Throw
|
||||||
}
|
}
|
||||||
|
|
||||||
|
It "has a switch parameter to return the headers" {
|
||||||
|
Get-Command $global:function | Should -HaveParameter returnHeaders
|
||||||
|
Get-Command $global:function | Should -HaveParameter returnHeaders -Type Switch
|
||||||
|
}
|
||||||
|
|
||||||
|
It "has a switch parameter to auto reauthorize the session" {
|
||||||
|
Get-Command $global:function | Should -HaveParameter autoReconnect
|
||||||
|
Get-Command $global:function | Should -HaveParameter autoReconnect -Type Switch
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
InModuleScope -ModuleName ZertoApiWrapper {
|
InModuleScope -ModuleName ZertoApiWrapper {
|
||||||
|
|||||||
Reference in New Issue
Block a user