Merge pull request #77 from ZertoPublic/Pester5Prep

Pester 5 prep
This commit is contained in:
Wes Carroll
2020-04-20 17:00:00 -04:00
committed by GitHub
108 changed files with 409 additions and 410 deletions
+13 -13
View File
@@ -1,45 +1,45 @@
#Requires -Modules Pester #Requires -Modules Pester
$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) $global:here = (Split-Path -Parent $PSCommandPath)
$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] $global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0]
Describe $global:function -Tag 'Unit', 'Source', 'Built' { Describe $global:function -Tag 'Unit', 'Source', 'Built' {
InModuleScope -ModuleName ZertoApiWrapper { InModuleScope -ModuleName ZertoApiWrapper {
Context "$global:function::Parameter Unit Tests" { Context "$global:function::Parameter Unit Tests" {
it "have a mandatory parameter for the Input Object" { It "have a mandatory parameter for the Input Object" {
Get-Command $global:function | Should -HaveParameter InputObject -Mandatory -Type PSCustomObject Get-Command $global:function | Should -HaveParameter InputObject -Mandatory -Type PSCustomObject
} }
it "Input Object should not accecpt a Null or Empty value" { It "Input Object should not accecpt a Null or Empty value" {
$myObj = [PSCustomObject]@{ } $myObj = [PSCustomObject]@{ }
{ Get-Map -InputObject $myObj -Key "Key" -Value "Value" } | Should Throw { Get-Map -InputObject $myObj -Key "Key" -Value "Value" } | Should Throw
{ Get-Map -InputObject $null -Key "Key" -Value "Value" } | Should Throw { Get-Map -InputObject $null -Key "Key" -Value "Value" } | Should Throw
{ Get-Map -InputObject "" -Key "Key" -Value "Value" } | Should Throw { Get-Map -InputObject "" -Key "Key" -Value "Value" } | Should Throw
} }
it "have a mandatory string parameter for the Map Key" { It "have a mandatory string parameter for the Map Key" {
Get-Command $global:function | Should -HaveParameter Key -Mandatory -Type String Get-Command $global:function | Should -HaveParameter Key -Mandatory -Type String
} }
it "The Map variable should not accecpt a Null or Empty value" { It "The Map variable should not accecpt a Null or Empty value" {
$myObj = [PSCustomObject]@{one = 1; two = 2 } $myObj = [PSCustomObject]@{one = 1; two = 2 }
{ Get-Map -InputObject $myObj -Key "" -Value "Value" } | Should Throw { Get-Map -InputObject $myObj -Key "" -Value "Value" } | Should Throw
{ Get-Map -InputObject $null -Key $null -Value "Value" } | Should Throw { Get-Map -InputObject $null -Key $null -Value "Value" } | Should Throw
{ Get-Map -InputObject $myObj -Key 1 -Value "Value" } | Should Throw { Get-Map -InputObject $myObj -Key 1 -Value "Value" } | Should Throw
} }
it "The Value variable should not accecpt a Null or Empty value" { It "The Value variable should not accecpt a Null or Empty value" {
$myObj = [PSCustomObject]@{one = 1; two = 2 } $myObj = [PSCustomObject]@{one = 1; two = 2 }
{ Get-Map -InputObject $myObj -Key "Key" -Value "" } | Should Throw { Get-Map -InputObject $myObj -Key "Key" -Value "" } | Should Throw
{ Get-Map -InputObject $myObj -Key "Key" -Value $null } | Should Throw { Get-Map -InputObject $myObj -Key "Key" -Value $null } | Should Throw
{ Get-Map -InputObject $myObj -Key "Key" -Value 1 } | Should Throw { Get-Map -InputObject $myObj -Key "Key" -Value 1 } | Should Throw
} }
it "have a mandatory string parameter for the Map Value" { It "have a mandatory string parameter for the Map Value" {
Get-Command $global:function | Should -HaveParameter Value -Mandatory -Type String Get-Command $global:function | Should -HaveParameter Value -Mandatory -Type String
} }
it "should have an Output type of Hashtable" { It "should have an Output type of Hashtable" {
(Get-Command $global:function).OutputType.Name | Should -Match "Hashtable" (Get-Command $global:function).OutputType.Name | Should -Match "Hashtable"
} }
} }
@@ -49,15 +49,15 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' {
BeforeEach { BeforeEach {
$MyMap = Get-Map -InputObject $MyObj -Key "vmIdentifier" -Value "vmName" $MyMap = Get-Map -InputObject $MyObj -Key "vmIdentifier" -Value "vmName"
} }
it "Returned object should be a hashtable" { It "Returned object should be a hashtable" {
$myMap | Should -BeOfType Hashtable $myMap | Should -BeOfType Hashtable
} }
it "should return a hashtable with 3 entries" { It "should return a hashtable with 3 entries" {
$myMap.count | should -Be 3 $myMap.count | Should -Be 3
} }
it "should be properly mapped" { It "should be properly mapped" {
$myMap["vmid.12"] | Should -Be "ExchangeMailbox" $myMap["vmid.12"] | Should -Be "ExchangeMailbox"
$myMap["vmid.13"] | Should -Be "ExchangeApplication" $myMap["vmid.13"] | Should -Be "ExchangeApplication"
$myMap["vmid.14"] | Should -Be "ExchangeWeb" $myMap["vmid.14"] | Should -Be "ExchangeWeb"
+10 -10
View File
@@ -1,6 +1,6 @@
#Requires -Modules Pester #Requires -Modules Pester
$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) $global:here = (Split-Path -Parent $PSCommandPath)
$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] $global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0]
Describe $global:function -Tag 'Unit', 'Source', 'Built' { Describe $global:function -Tag 'Unit', 'Source', 'Built' {
@@ -16,7 +16,7 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' {
{ Get-ZertoApiFilter -filtertable $null } | Should Throw { Get-ZertoApiFilter -filtertable $null } | Should Throw
} }
it "should have an Output type of String" { It "should have an Output type of String" {
(Get-Command $global:function).OutputType.Name | Should -Match "String" (Get-Command $global:function).OutputType.Name | Should -Match "String"
} }
} }
@@ -47,19 +47,19 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' {
} }
} }
it "converts bool to text" { It "converts bool to text" {
Get-ZertoApiFilter -filtertable $singleBoolItemTest | should -Be "?BoolItem=True" Get-ZertoApiFilter -filtertable $singleBoolItemTest | Should -Be "?BoolItem=True"
} }
it "one item test" { It "one item test" {
Get-ZertoApiFilter -filtertable $oneItemTest | should be "?OneItem=Test" Get-ZertoApiFilter -filtertable $oneItemTest | Should -Be "?OneItem=Test"
} }
it "should ignore CommonParameters" { It "should ignore CommonParameters" {
Get-ZertoApiFilter -filtertable $commonParamTest | should be "?OneItem=Test" Get-ZertoApiFilter -filtertable $commonParamTest | Should -Be "?OneItem=Test"
} }
it "should process a filter table with more than one item" { It "should process a filter table with more than one item" {
$returnString = Get-ZertoApiFilter -filtertable $twoItemTest $returnString = Get-ZertoApiFilter -filtertable $twoItemTest
$returnString | Should -match "^\?" $returnString | Should -match "^\?"
$returnString | Should -match "&" $returnString | Should -match "&"
+5 -5
View File
@@ -1,6 +1,6 @@
#Requires -Modules Pester #Requires -Modules Pester
$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) $global:here = (Split-Path -Parent $PSCommandPath)
$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).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 {
@@ -43,7 +43,7 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' {
} }
default { default {
$true | Should be $false -Because "No Validation Selected. Review test cases" $true | Should -Be $false -Because "No Validation Selected. Review test cases"
} }
} }
} }
@@ -53,11 +53,11 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' {
} }
It "targetPort Parameter should have a Min value of 1024" { It "targetPort Parameter should have a Min value of 1024" {
(Get-Command $global:function).Parameters['targetPort'].Attributes.Where{ $_ -is [ValidateRange] }.MinRange | Should Be 1024 (Get-Command $global:function).Parameters['targetPort'].Attributes.Where{ $_ -is [ValidateRange] }.MinRange | Should -Be 1024
} }
It "targetPort Parameter should have a Max value of 65535" { It "targetPort Parameter should have a Max value of 65535" {
(Get-Command $global:function).Parameters['targetPort'].Attributes.Where{ $_ -is [ValidateRange] }.MaxRange | Should Be 65535 (Get-Command $global:function).Parameters['targetPort'].Attributes.Where{ $_ -is [ValidateRange] }.MaxRange | Should -Be 65535
} }
It "Supports 'SupportsShouldProcess'" { It "Supports 'SupportsShouldProcess'" {
+2 -2
View File
@@ -1,6 +1,6 @@
#Requires -Modules Pester #Requires -Modules Pester
$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) $global:here = (Split-Path -Parent $PSCommandPath)
$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).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 {
@@ -1,6 +1,6 @@
#Requires -Modules Pester #Requires -Modules Pester
$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) $global:here = (Split-Path -Parent $PSCommandPath)
$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).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 {
@@ -13,8 +13,6 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' {
} }
} }
Context "$($global:function)::Function Unit Tests" { Context "$($global:function)::Function Unit Tests" {
InModuleScope -ModuleName ZertoApiWrapper { InModuleScope -ModuleName ZertoApiWrapper {
@@ -68,7 +66,6 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' {
Assert-MockCalled -ModuleName ZertoApiWrapper -CommandName Invoke-ZARestRequest -Exactly 1 Assert-MockCalled -ModuleName ZertoApiWrapper -CommandName Invoke-ZARestRequest -Exactly 1
} }
} }
Remove-Variable -Name function -Scope Global Remove-Variable -Name function -Scope Global
+6 -6
View File
@@ -1,6 +1,6 @@
#Requires -Modules Pester #Requires -Modules Pester
$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) $global:here = (Split-Path -Parent $PSCommandPath)
$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).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 {
@@ -105,11 +105,11 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' {
$headers = Connect-ZertoServer -zertoServer $Server -credential $credential -returnHeaders $headers = Connect-ZertoServer -zertoServer $Server -credential $credential -returnHeaders
It "returns a Hashtable with 2 keys" { It "returns a Hashtable with 2 keys" {
$headers | Should -BeOfType Hashtable $headers | Should -BeOfType Hashtable
$headers.keys.count | Should be 2 $headers.keys.count | Should -Be 2
} }
It "return value has a key called 'x-zerto-session'" { It "return value has a key called 'x-zerto-session'" {
$headers.ContainsKey('x-zerto-session') | Should be $true $headers.ContainsKey('x-zerto-session') | Should -Be $true
} }
It "return key 'x-zerto-session' value should be a string" { It "return key 'x-zerto-session' value should be a string" {
@@ -118,11 +118,11 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' {
} }
It "return value has a key called 'accept'" { It "return value has a key called 'accept'" {
$headers.ContainsKey('accept') | Should be $true $headers.ContainsKey('accept') | Should -Be $true
} }
It "return key 'accept' value should be 'application/json'" { It "return key 'accept' value should be 'application/json'" {
$headers['accept'] | Should be 'application/json' $headers['accept'] | Should -Be 'application/json'
} }
It "should not require a port to be specified" { It "should not require a port to be specified" {
+2 -2
View File
@@ -1,6 +1,6 @@
#Requires -Modules Pester #Requires -Modules Pester
$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) $global:here = (Split-Path -Parent $PSCommandPath)
$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).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 {
@@ -1,6 +1,6 @@
#Requires -Modules Pester #Requires -Modules Pester
$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) $global:here = (Split-Path -Parent $PSCommandPath)
$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] $global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0]
Describe $global:function -Tag 'Unit', 'Source', 'Built' { Describe $global:function -Tag 'Unit', 'Source', 'Built' {
+8 -8
View File
@@ -1,6 +1,6 @@
#Requires -Modules Pester #Requires -Modules Pester
$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) $global:here = (Split-Path -Parent $PSCommandPath)
$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] $global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0]
Describe $global:function -Tag 'Unit', 'Source', 'Built' { Describe $global:function -Tag 'Unit', 'Source', 'Built' {
@@ -28,7 +28,7 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' {
@{ParameterName = 'vraIpAddress'; Type = 'String'; Mandatory = $false } @{ParameterName = 'vraIpAddress'; Type = 'String'; Mandatory = $false }
@{ParameterName = 'defaultGateway'; Type = 'String'; Mandatory = $false } @{ParameterName = 'defaultGateway'; Type = 'String'; Mandatory = $false }
@{ParameterName = 'subnetMask'; Type = 'String'; Mandatory = $false } @{ParameterName = 'subnetMask'; Type = 'String'; Mandatory = $false }
@{ParameterName = 'HostRootPassword'; Type = 'securestring'; Mandatory = $false} @{ParameterName = 'HostRootPassword'; Type = 'securestring'; Mandatory = $false }
) )
It "<ParameterName> parameter is of <Type> type" -TestCases $ParameterTestCases { It "<ParameterName> parameter is of <Type> type" -TestCases $ParameterTestCases {
@@ -41,7 +41,7 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' {
@{ ParameterName = 'groupName' } @{ ParameterName = 'groupName' }
) )
it "<ParameterName> validates against null or empty values" -TestCases $StringTestCases { It "<ParameterName> validates against null or empty values" -TestCases $StringTestCases {
param($ParameterName) param($ParameterName)
$attrs = (Get-Command $global:function).Parameters[$ParameterName].Attributes $attrs = (Get-Command $global:function).Parameters[$ParameterName].Attributes
$attrs.Where{ $_ -is [ValidateNotNullOrEmpty] }.Count | Should -Be 1 $attrs.Where{ $_ -is [ValidateNotNullOrEmpty] }.Count | Should -Be 1
@@ -53,7 +53,7 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' {
@{ParameterName = 'subnetMask' } @{ParameterName = 'subnetMask' }
) )
it "<ParameterName> validates string for a valid IP Address" -TestCases $IpAddrTestCases { It "<ParameterName> validates string for a valid IP Address" -TestCases $IpAddrTestCases {
param($ParameterName) param($ParameterName)
$attrs = (Get-Command $global:function).Parameters[$ParameterName].Attributes $attrs = (Get-Command $global:function).Parameters[$ParameterName].Attributes
$attrs.Where{ $_ -is [ValidateScript] }.Count | Should -Be 1 $attrs.Where{ $_ -is [ValidateScript] }.Count | Should -Be 1
@@ -65,8 +65,8 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' {
It "Returns a task id string" { It "Returns a task id string" {
$results = Edit-ZertoVra -vraIdentifier "MyVraIdentifier" -groupName "MyGroup" $results = Edit-ZertoVra -vraIdentifier "MyVraIdentifier" -groupName "MyGroup"
$results | should not benullorempty $results | Should not benullorempty
$results | should -BeOfType "String" $results | Should -BeOfType "String"
$results | Should -BeExactly "7e79035e-fb8c-47fe-815c-12ddd41708e6.3e4cdd0d-1064-4022-921f-6265ad6d335a" $results | Should -BeExactly "7e79035e-fb8c-47fe-815c-12ddd41708e6.3e4cdd0d-1064-4022-921f-6265ad6d335a"
} }
@@ -82,7 +82,7 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' {
Edit-ZertoVra -vraIdentifier "DhcpVraIdentifier" -groupName "MyNewGroup" | Should -BeExactly "7e79035e-fb8c-47fe-815c-12ddd41708e6.3e4cdd0d-1064-4022-921f-6265ad6d335a" Edit-ZertoVra -vraIdentifier "DhcpVraIdentifier" -groupName "MyNewGroup" | Should -BeExactly "7e79035e-fb8c-47fe-815c-12ddd41708e6.3e4cdd0d-1064-4022-921f-6265ad6d335a"
} }
it "Supports 'SupportsShouldProcess'" { It "Supports 'SupportsShouldProcess'" {
Get-Command $global:function | Should -HaveParameter WhatIf Get-Command $global:function | Should -HaveParameter WhatIf
Get-Command $global:function | Should -HaveParameter Confirm Get-Command $global:function | Should -HaveParameter Confirm
(Get-Command $global:function).ScriptBlock | Should -Match 'SupportsShouldProcess' (Get-Command $global:function).ScriptBlock | Should -Match 'SupportsShouldProcess'
@@ -1,6 +1,6 @@
#Requires -Modules Pester #Requires -Modules Pester
$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) $global:here = (Split-Path -Parent $PSCommandPath)
$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] $global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0]
Describe $global:function -Tag 'Unit', 'Source', 'Built' { Describe $global:function -Tag 'Unit', 'Source', 'Built' {
@@ -16,7 +16,7 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' {
Get-Command $global:function | Should -HaveParameter $ParameterName -Mandatory:$Mandatory -Type $Type Get-Command $global:function | Should -HaveParameter $ParameterName -Mandatory:$Mandatory -Type $Type
} }
it "<ParameterName> has <Validation> validation set" -TestCases $ParameterTestCases { It "<ParameterName> has <Validation> validation set" -TestCases $ParameterTestCases {
param($ParameterName) param($ParameterName)
$attrs = (Get-Command $global:function).Parameters[$ParameterName].Attributes $attrs = (Get-Command $global:function).Parameters[$ParameterName].Attributes
$attrs.Where{ $_ -is [ValidateNotNullOrEmpty] }.Count | Should -Be 1 $attrs.Where{ $_ -is [ValidateNotNullOrEmpty] }.Count | Should -Be 1
@@ -24,7 +24,7 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' {
} }
Context "$global:function::Function Unit Tests" { Context "$global:function::Function Unit Tests" {
} }
} }
+6 -6
View File
@@ -1,6 +1,6 @@
#Requires -Modules Pester #Requires -Modules Pester
$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) $global:here = (Split-Path -Parent $PSCommandPath)
$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] $global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0]
Describe $global:function -Tag 'Unit', 'Source', 'Built' { Describe $global:function -Tag 'Unit', 'Source', 'Built' {
@@ -199,11 +199,11 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' {
$outputPath = "TestDrive:" $outputPath = "TestDrive:"
it "Output path should exist" { It "Output path should exist" {
$outputPath | Should -Exist $outputPath | Should -Exist
} }
it "Exported JSON file should exist after function called" { It "Exported JSON file should exist after function called" {
$vpgName = "HRIS" $vpgName = "HRIS"
Export-ZertoVpg -outputPath $outputPath -vpgName $vpgName Export-ZertoVpg -outputPath $outputPath -vpgName $vpgName
$outputFile = "{0}\{1}.json" -f $outputPath, $vpgName $outputFile = "{0}\{1}.json" -f $outputPath, $vpgName
@@ -211,11 +211,11 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' {
$outputFile | Should -Not -BeNullOrEmpty $outputFile | Should -Not -BeNullOrEmpty
} }
it "Only one file should be present in the TestDrive" { It "Only one file should be present in the TestDrive" {
(Get-ChildItem $outputPath).Count | Should -BeExactly 1 (Get-ChildItem $outputPath).Count | Should -BeExactly 1
} }
it "Should be valid JSON" { It "Should be valid JSON" {
$vpgName = "HRIS" $vpgName = "HRIS"
Export-ZertoVpg -outputPath $outputPath -vpgName $vpgName Export-ZertoVpg -outputPath $outputPath -vpgName $vpgName
$outputFile = "{0}\{1}.json" -f $outputPath, $vpgName $outputFile = "{0}\{1}.json" -f $outputPath, $vpgName
+7 -7
View File
@@ -1,13 +1,13 @@
#Requires -Modules Pester #Requires -Modules Pester
$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) $global:here = (Split-Path -Parent $PSCommandPath)
$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] $global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0]
Describe $global:function -Tag 'Unit', 'Source', 'Built' { Describe $global:function -Tag 'Unit', 'Source', 'Built' {
Context "$global:function::Parameter Unit Tests" { Context "$global:function::Parameter Unit Tests" {
it "$global:function should have exactly 14 parameters defined" { It "$global:function should have exactly 14 parameters defined" {
(get-command $global:function).Parameters.Count | Should -Be 14 (Get-Command $global:function).Parameters.Count | Should -Be 14
} }
$ParameterTestCases = @( $ParameterTestCases = @(
@@ -35,17 +35,17 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' {
} }
default { default {
$true | should be $false -Because "No Validation Selected. Review test cases" $true | Should -Be $false -Because "No Validation Selected. Review test cases"
} }
} }
} }
It "LimitTo Parameter should have a Min value of 1" { It "LimitTo Parameter should have a Min value of 1" {
(Get-Command $global:function).Parameters['limitTo'].Attributes.Where{ $_ -is [ValidateRange] }.MinRange | Should Be 1 (Get-Command $global:function).Parameters['limitTo'].Attributes.Where{ $_ -is [ValidateRange] }.MinRange | Should -Be 1
} }
It "LimitTo Parameter should have a Max value of 1000000" { It "LimitTo Parameter should have a Max value of 1000000" {
(Get-Command $global:function).Parameters['limitTo'].Attributes.Where{ $_ -is [ValidateRange] }.MaxRange | Should Be 1000000 (Get-Command $global:function).Parameters['limitTo'].Attributes.Where{ $_ -is [ValidateRange] }.MaxRange | Should -Be 1000000
} }
} }
+5 -5
View File
@@ -1,12 +1,12 @@
#Requires -Modules Pester #Requires -Modules Pester
$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) $global:here = (Split-Path -Parent $PSCommandPath)
$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] $global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0]
Describe $global:function -Tag 'Unit', 'Source', 'Built' { Describe $global:function -Tag 'Unit', 'Source', 'Built' {
Context "$global:function::Parameter Unit Tests" { Context "$global:function::Parameter Unit Tests" {
it "$global:function should have exactly 14 parameters defined" { It "$global:function should have exactly 14 parameters defined" {
(get-command $global:function).Parameters.Count | Should -Be 14 (Get-Command $global:function).Parameters.Count | Should -Be 14
} }
$ParameterTestCases = @( $ParameterTestCases = @(
@@ -29,7 +29,7 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' {
} }
default { default {
$true | should be $false -Because "No Validation Selected. Review test cases" $true | Should -Be $false -Because "No Validation Selected. Review test cases"
} }
} }
} }
+8 -8
View File
@@ -1,13 +1,13 @@
#Requires -Modules Pester #Requires -Modules Pester
$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) $global:here = (Split-Path -Parent $PSCommandPath)
$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] $global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0]
Describe $global:function -Tag 'Unit', 'Source', 'Built' { Describe $global:function -Tag 'Unit', 'Source', 'Built' {
Context "$global:function::Parameter Unit Tests" { Context "$global:function::Parameter Unit Tests" {
it "$global:function should have exactly 16 parameters defined" { It "$global:function should have exactly 16 parameters defined" {
(get-command $global:function).Parameters.Count | Should -Be 16 (Get-Command $global:function).Parameters.Count | Should -Be 16
} }
$ParameterTestCases = @( $ParameterTestCases = @(
@@ -42,21 +42,21 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' {
} }
default { default {
$true | should be $false -Because "No Validation Selected. Review test cases" $true | Should -Be $false -Because "No Validation Selected. Review test cases"
} }
} }
} }
It "LimitTo Parameter should have a Min value of 1" { It "LimitTo Parameter should have a Min value of 1" {
(Get-Command $global:function).Parameters['limitTo'].Attributes.Where{ $_ -is [ValidateRange] }.MinRange | Should Be 1 (Get-Command $global:function).Parameters['limitTo'].Attributes.Where{ $_ -is [ValidateRange] }.MinRange | Should -Be 1
} }
It "LimitTo Parameter should have a Max value of 1000000" { It "LimitTo Parameter should have a Max value of 1000000" {
(Get-Command $global:function).Parameters['limitTo'].Attributes.Where{ $_ -is [ValidateRange] }.MaxRange | Should Be 1000000 (Get-Command $global:function).Parameters['limitTo'].Attributes.Where{ $_ -is [ValidateRange] }.MaxRange | Should -Be 1000000
} }
It "Category parameter should only have 2 options" { It "Category parameter should only have 2 options" {
(Get-Command $global:function).Parameters['category'].Attributes.Where{ $_ -is [ValidateSet] }.ValidValues.Count | Should Be 2 (Get-Command $global:function).Parameters['category'].Attributes.Where{ $_ -is [ValidateSet] }.ValidValues.Count | Should -Be 2
} }
It "Category parameter should take 'events'" { It "Category parameter should take 'events'" {
@@ -1,13 +1,13 @@
#Requires -Modules Pester #Requires -Modules Pester
$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) $global:here = (Split-Path -Parent $PSCommandPath)
$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] $global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0]
Describe $global:function -Tag 'Unit', 'Source', 'Built' { Describe $global:function -Tag 'Unit', 'Source', 'Built' {
Context "$global:function::Parameter Unit Tests" { Context "$global:function::Parameter Unit Tests" {
it "$global:function should have exactly 15 parameters defined" { It "$global:function should have exactly 15 parameters defined" {
(get-command $global:function).Parameters.Count | Should -Be 15 (Get-Command $global:function).Parameters.Count | Should -Be 15
} }
$ParameterTestCases = @( $ParameterTestCases = @(
@@ -36,17 +36,17 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' {
} }
default { default {
$true | should be $false -Because "No Validation Selected. Review test cases" $true | Should -Be $false -Because "No Validation Selected. Review test cases"
} }
} }
} }
It "Interval Parameter should have a Min value of 60" { It "Interval Parameter should have a Min value of 60" {
(Get-Command $global:function).Parameters['Interval'].Attributes.Where{ $_ -is [ValidateRange] }.MinRange | Should Be 60 (Get-Command $global:function).Parameters['Interval'].Attributes.Where{ $_ -is [ValidateRange] }.MinRange | Should -Be 60
} }
It "Interval Parameter should have a Max value of 2678400" { It "Interval Parameter should have a Max value of 2678400" {
(Get-Command $global:function).Parameters['Interval'].Attributes.Where{ $_ -is [ValidateRange] }.MaxRange | Should Be 2678400 (Get-Command $global:function).Parameters['Interval'].Attributes.Where{ $_ -is [ValidateRange] }.MaxRange | Should -Be 2678400
} }
} }
@@ -1,12 +1,12 @@
#Requires -Modules Pester #Requires -Modules Pester
$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) $global:here = (Split-Path -Parent $PSCommandPath)
$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] $global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0]
Describe $global:function -Tag 'Unit', 'Source', 'Built' { Describe $global:function -Tag 'Unit', 'Source', 'Built' {
Context "$global:function::Parameter Unit Tests" { Context "$global:function::Parameter Unit Tests" {
it "$global:function should have exactly 15 parameters defined" { It "$global:function should have exactly 15 parameters defined" {
(get-command $global:function).Parameters.Count | Should -Be 15 (Get-Command $global:function).Parameters.Count | Should -Be 15
} }
$ParameterTestCases = @( $ParameterTestCases = @(
@@ -35,17 +35,17 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' {
} }
default { default {
$true | should be $false -Because "No Validation Selected. Review test cases" $true | Should -Be $false -Because "No Validation Selected. Review test cases"
} }
} }
} }
It "Interval Parameter should have a Min value of 60" { It "Interval Parameter should have a Min value of 60" {
(Get-Command $global:function).Parameters['Interval'].Attributes.Where{ $_ -is [ValidateRange] }.MinRange | Should Be 60 (Get-Command $global:function).Parameters['Interval'].Attributes.Where{ $_ -is [ValidateRange] }.MinRange | Should -Be 60
} }
It "Interval Parameter should have a Max value of 2678400" { It "Interval Parameter should have a Max value of 2678400" {
(Get-Command $global:function).Parameters['Interval'].Attributes.Where{ $_ -is [ValidateRange] }.MaxRange | Should Be 2678400 (Get-Command $global:function).Parameters['Interval'].Attributes.Where{ $_ -is [ValidateRange] }.MaxRange | Should -Be 2678400
} }
} }
+5 -5
View File
@@ -1,12 +1,12 @@
#Requires -Modules Pester #Requires -Modules Pester
$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) $global:here = (Split-Path -Parent $PSCommandPath)
$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] $global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0]
Describe $global:function -Tag 'Unit', 'Source', 'Built' { Describe $global:function -Tag 'Unit', 'Source', 'Built' {
Context "$global:function::Parameter Unit Tests" { Context "$global:function::Parameter Unit Tests" {
it "$global:function should have exactly 14 parameters defined" { It "$global:function should have exactly 14 parameters defined" {
(get-command $global:function).Parameters.Count | Should -Be 14 (Get-Command $global:function).Parameters.Count | Should -Be 14
} }
$ParameterTestCases = @( $ParameterTestCases = @(
@@ -29,7 +29,7 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' {
} }
default { default {
$true | should be $false -Because "No Validation Selected. Review test cases" $true | Should -Be $false -Because "No Validation Selected. Review test cases"
} }
} }
} }
@@ -1,12 +1,12 @@
#Requires -Modules Pester #Requires -Modules Pester
$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) $global:here = (Split-Path -Parent $PSCommandPath)
$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] $global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0]
Describe $global:function -Tag 'Unit', 'Source', 'Built' { Describe $global:function -Tag 'Unit', 'Source', 'Built' {
Context "$global:function::Parameter Unit Tests" { Context "$global:function::Parameter Unit Tests" {
it "$global:function should have exactly 14 parameters defined" { It "$global:function should have exactly 14 parameters defined" {
(get-command $global:function).Parameters.Count | Should -Be 14 (Get-Command $global:function).Parameters.Count | Should -Be 14
} }
$ParameterTestCases = @( $ParameterTestCases = @(
@@ -29,7 +29,7 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' {
} }
default { default {
$true | should be $false -Because "No Validation Selected. Review test cases" $true | Should -Be $false -Because "No Validation Selected. Review test cases"
} }
} }
} }
@@ -1,12 +1,12 @@
#Requires -Modules Pester #Requires -Modules Pester
$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) $global:here = (Split-Path -Parent $PSCommandPath)
$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] $global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0]
Describe $global:function -Tag 'Unit', 'Source', 'Built' { Describe $global:function -Tag 'Unit', 'Source', 'Built' {
Context "$global:function::Parameter Unit Tests" { Context "$global:function::Parameter Unit Tests" {
it "$global:function should have exactly 15 parameters defined" { It "$global:function should have exactly 15 parameters defined" {
(get-command $global:function).Parameters.Count | Should -Be 15 (Get-Command $global:function).Parameters.Count | Should -Be 15
} }
$ParameterTestCases = @( $ParameterTestCases = @(
@@ -35,17 +35,17 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' {
} }
default { default {
$true | should be $false -Because "No Validation Selected. Review test cases" $true | Should -Be $false -Because "No Validation Selected. Review test cases"
} }
} }
} }
It "Interval Parameter should have a Min value of 60" { It "Interval Parameter should have a Min value of 60" {
(Get-Command $global:function).Parameters['Interval'].Attributes.Where{ $_ -is [ValidateRange] }.MinRange | Should Be 60 (Get-Command $global:function).Parameters['Interval'].Attributes.Where{ $_ -is [ValidateRange] }.MinRange | Should -Be 60
} }
It "Interval Parameter should have a Max value of 2678400" { It "Interval Parameter should have a Max value of 2678400" {
(Get-Command $global:function).Parameters['Interval'].Attributes.Where{ $_ -is [ValidateRange] }.MaxRange | Should Be 2678400 (Get-Command $global:function).Parameters['Interval'].Attributes.Where{ $_ -is [ValidateRange] }.MaxRange | Should -Be 2678400
} }
} }
@@ -1,12 +1,12 @@
#Requires -Modules Pester #Requires -Modules Pester
$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) $global:here = (Split-Path -Parent $PSCommandPath)
$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] $global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0]
Describe $global:function -Tag 'Unit', 'Source', 'Built' { Describe $global:function -Tag 'Unit', 'Source', 'Built' {
Context "$global:function::Parameter Unit Tests" { Context "$global:function::Parameter Unit Tests" {
it "$global:function should have exactly 15 parameters defined" { It "$global:function should have exactly 15 parameters defined" {
(get-command $global:function).Parameters.Count | Should -Be 15 (Get-Command $global:function).Parameters.Count | Should -Be 15
} }
$ParameterTestCases = @( $ParameterTestCases = @(
@@ -35,17 +35,17 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' {
} }
default { default {
$true | should be $false -Because "No Validation Selected. Review test cases" $true | Should -Be $false -Because "No Validation Selected. Review test cases"
} }
} }
} }
It "Interval Parameter should have a Min value of 60" { It "Interval Parameter should have a Min value of 60" {
(Get-Command $global:function).Parameters['Interval'].Attributes.Where{ $_ -is [ValidateRange] }.MinRange | Should Be 60 (Get-Command $global:function).Parameters['Interval'].Attributes.Where{ $_ -is [ValidateRange] }.MinRange | Should -Be 60
} }
It "Interval Parameter should have a Max value of 2678400" { It "Interval Parameter should have a Max value of 2678400" {
(Get-Command $global:function).Parameters['Interval'].Attributes.Where{ $_ -is [ValidateRange] }.MaxRange | Should Be 2678400 (Get-Command $global:function).Parameters['Interval'].Attributes.Where{ $_ -is [ValidateRange] }.MaxRange | Should -Be 2678400
} }
} }
@@ -1,12 +1,12 @@
#Requires -Modules Pester #Requires -Modules Pester
$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) $global:here = (Split-Path -Parent $PSCommandPath)
$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] $global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0]
Describe $global:function -Tag 'Unit', 'Source', 'Built' { Describe $global:function -Tag 'Unit', 'Source', 'Built' {
Context "$global:function::Parameter Unit Tests" { Context "$global:function::Parameter Unit Tests" {
it "$global:function should have exactly 15 parameters defined" { It "$global:function should have exactly 15 parameters defined" {
(get-command $global:function).Parameters.Count | Should -Be 15 (Get-Command $global:function).Parameters.Count | Should -Be 15
} }
$ParameterTestCases = @( $ParameterTestCases = @(
@@ -35,17 +35,17 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' {
} }
default { default {
$true | should be $false -Because "No Validation Selected. Review test cases" $true | Should -Be $false -Because "No Validation Selected. Review test cases"
} }
} }
} }
It "Interval Parameter should have a Min value of 60" { It "Interval Parameter should have a Min value of 60" {
(Get-Command $global:function).Parameters['Interval'].Attributes.Where{ $_ -is [ValidateRange] }.MinRange | Should Be 60 (Get-Command $global:function).Parameters['Interval'].Attributes.Where{ $_ -is [ValidateRange] }.MinRange | Should -Be 60
} }
It "Interval Parameter should have a Max value of 2678400" { It "Interval Parameter should have a Max value of 2678400" {
(Get-Command $global:function).Parameters['Interval'].Attributes.Where{ $_ -is [ValidateRange] }.MaxRange | Should Be 2678400 (Get-Command $global:function).Parameters['Interval'].Attributes.Where{ $_ -is [ValidateRange] }.MaxRange | Should -Be 2678400
} }
} }
@@ -1,12 +1,12 @@
#Requires -Modules Pester #Requires -Modules Pester
$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) $global:here = (Split-Path -Parent $PSCommandPath)
$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] $global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0]
Describe $global:function -Tag 'Unit', 'Source', 'Built' { Describe $global:function -Tag 'Unit', 'Source', 'Built' {
Context "$global:function::Parameter Unit Tests" { Context "$global:function::Parameter Unit Tests" {
it "$global:function should have exactly 15 parameters defined" { It "$global:function should have exactly 15 parameters defined" {
(get-command $global:function).Parameters.Count | Should -Be 15 (Get-Command $global:function).Parameters.Count | Should -Be 15
} }
$ParameterTestCases = @( $ParameterTestCases = @(
@@ -35,17 +35,17 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' {
} }
default { default {
$true | should be $false -Because "No Validation Selected. Review test cases" $true | Should -Be $false -Because "No Validation Selected. Review test cases"
} }
} }
} }
It "Interval Parameter should have a Min value of 60" { It "Interval Parameter should have a Min value of 60" {
(Get-Command $global:function).Parameters['Interval'].Attributes.Where{ $_ -is [ValidateRange] }.MinRange | Should Be 60 (Get-Command $global:function).Parameters['Interval'].Attributes.Where{ $_ -is [ValidateRange] }.MinRange | Should -Be 60
} }
It "Interval Parameter should have a Max value of 2678400" { It "Interval Parameter should have a Max value of 2678400" {
(Get-Command $global:function).Parameters['Interval'].Attributes.Where{ $_ -is [ValidateRange] }.MaxRange | Should Be 2678400 (Get-Command $global:function).Parameters['Interval'].Attributes.Where{ $_ -is [ValidateRange] }.MaxRange | Should -Be 2678400
} }
} }
@@ -1,12 +1,12 @@
#Requires -Modules Pester #Requires -Modules Pester
$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) $global:here = (Split-Path -Parent $PSCommandPath)
$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] $global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0]
Describe $global:function -Tag 'Unit', 'Source', 'Built' { Describe $global:function -Tag 'Unit', 'Source', 'Built' {
Context "$global:function::Parameter Unit Tests" { Context "$global:function::Parameter Unit Tests" {
it "$global:function should have exactly 15 parameters defined" { It "$global:function should have exactly 15 parameters defined" {
(get-command $global:function).Parameters.Count | Should -Be 15 (Get-Command $global:function).Parameters.Count | Should -Be 15
} }
$ParameterTestCases = @( $ParameterTestCases = @(
@@ -35,17 +35,17 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' {
} }
default { default {
$true | should be $false -Because "No Validation Selected. Review test cases" $true | Should -Be $false -Because "No Validation Selected. Review test cases"
} }
} }
} }
It "Interval Parameter should have a Min value of 60" { It "Interval Parameter should have a Min value of 60" {
(Get-Command $global:function).Parameters['Interval'].Attributes.Where{ $_ -is [ValidateRange] }.MinRange | Should Be 60 (Get-Command $global:function).Parameters['Interval'].Attributes.Where{ $_ -is [ValidateRange] }.MinRange | Should -Be 60
} }
It "Interval Parameter should have a Max value of 2678400" { It "Interval Parameter should have a Max value of 2678400" {
(Get-Command $global:function).Parameters['Interval'].Attributes.Where{ $_ -is [ValidateRange] }.MaxRange | Should Be 2678400 (Get-Command $global:function).Parameters['Interval'].Attributes.Where{ $_ -is [ValidateRange] }.MaxRange | Should -Be 2678400
} }
} }
@@ -1,12 +1,12 @@
#Requires -Modules Pester #Requires -Modules Pester
$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) $global:here = (Split-Path -Parent $PSCommandPath)
$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] $global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0]
Describe $global:function -Tag 'Unit', 'Source', 'Built' { Describe $global:function -Tag 'Unit', 'Source', 'Built' {
Context "$global:function::Parameter Unit Tests" { Context "$global:function::Parameter Unit Tests" {
it "$global:function should have exactly 14 parameters defined" { It "$global:function should have exactly 14 parameters defined" {
(get-command $global:function).Parameters.Count | Should -Be 14 (Get-Command $global:function).Parameters.Count | Should -Be 14
} }
$ParameterTestCases = @( $ParameterTestCases = @(
@@ -29,7 +29,7 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' {
} }
default { default {
$true | should be $false -Because "No Validation Selected. Review test cases" $true | Should -Be $false -Because "No Validation Selected. Review test cases"
} }
} }
} }
@@ -1,12 +1,12 @@
#Requires -Modules Pester #Requires -Modules Pester
$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) $global:here = (Split-Path -Parent $PSCommandPath)
$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] $global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0]
Describe $global:function -Tag 'Unit', 'Source', 'Built' { Describe $global:function -Tag 'Unit', 'Source', 'Built' {
Context "$global:function::Parameter Unit Tests" { Context "$global:function::Parameter Unit Tests" {
it "$global:function should have exactly 14 parameters defined" { It "$global:function should have exactly 14 parameters defined" {
(get-command $global:function).Parameters.Count | Should -Be 14 (Get-Command $global:function).Parameters.Count | Should -Be 14
} }
$ParameterTestCases = @( $ParameterTestCases = @(
@@ -29,7 +29,7 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' {
} }
default { default {
$true | should be $false -Because "No Validation Selected. Review test cases" $true | Should -Be $false -Because "No Validation Selected. Review test cases"
} }
} }
} }
+5 -5
View File
@@ -1,12 +1,12 @@
#Requires -Modules Pester #Requires -Modules Pester
$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) $global:here = (Split-Path -Parent $PSCommandPath)
$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] $global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0]
Describe $global:function -Tag 'Unit', 'Source', 'Built' { Describe $global:function -Tag 'Unit', 'Source', 'Built' {
Context "$global:function::Parameter Unit Tests" { Context "$global:function::Parameter Unit Tests" {
it "$global:function should have exactly 14 parameters defined" { It "$global:function should have exactly 14 parameters defined" {
(get-command $global:function).Parameters.Count | Should -Be 14 (Get-Command $global:function).Parameters.Count | Should -Be 14
} }
$ParameterTestCases = @( $ParameterTestCases = @(
@@ -29,7 +29,7 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' {
} }
default { default {
$true | should be $false -Because "No Validation Selected. Review test cases" $true | Should -Be $false -Because "No Validation Selected. Review test cases"
} }
} }
} }
+4 -4
View File
@@ -1,12 +1,12 @@
#Requires -Modules Pester #Requires -Modules Pester
$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) $global:here = (Split-Path -Parent $PSCommandPath)
$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] $global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0]
Describe $global:function -Tag 'Unit', 'Source', 'Built' { Describe $global:function -Tag 'Unit', 'Source', 'Built' {
Context "$global:function::Parameter Unit Tests" { Context "$global:function::Parameter Unit Tests" {
it "$global:function should have exactly 11 parameters defined" { It "$global:function should have exactly 11 parameters defined" {
(get-command $global:function).Parameters.Count | Should -Be 11 (Get-Command $global:function).Parameters.Count | Should -Be 11
} }
} }
+5 -5
View File
@@ -1,15 +1,15 @@
#Requires -Modules Pester #Requires -Modules Pester
$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) $global:here = (Split-Path -Parent $PSCommandPath)
$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] $global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0]
Describe $global:function -Tag 'Unit', 'Source', 'Built' { Describe $global:function -Tag 'Unit', 'Source', 'Built' {
Context "$global:function::Parameter Unit Tests" { Context "$global:function::Parameter Unit Tests" {
it "$global:function should have exactly 12 parameters defined" { It "$global:function should have exactly 12 parameters defined" {
(get-command $global:function).Parameters.Count | Should -Be 12 (Get-Command $global:function).Parameters.Count | Should -Be 12
} }
it "$global:function has a non-mandatory string parameter for the zOrgIdentifier" { It "$global:function has a non-mandatory string parameter for the zOrgIdentifier" {
Get-Command $global:function | Should -HaveParameter zOrgIdentifier -Type String Get-Command $global:function | Should -HaveParameter zOrgIdentifier -Type String
Get-Command $global:function | Should -HaveParameter zOrgIdentifier -not -Mandatory Get-Command $global:function | Should -HaveParameter zOrgIdentifier -not -Mandatory
} }
@@ -1,6 +1,6 @@
#Requires -Modules Pester #Requires -Modules Pester
$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) $global:here = (Split-Path -Parent $PSCommandPath)
$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] $global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0]
Describe $global:function -Tag 'Unit', 'Source', 'Built' { Describe $global:function -Tag 'Unit', 'Source', 'Built' {
@@ -37,17 +37,17 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' {
} }
default { default {
$true | Should be $false -Because "No Validation Selected. Review test cases" $true | Should -Be $false -Because "No Validation Selected. Review test cases"
} }
} }
} }
It "Interval Parameter should have a Min value of 60" { It "Interval Parameter should have a Min value of 60" {
(Get-Command $global:function).Parameters['Interval'].Attributes.Where{ $_ -is [ValidateRange] }.MinRange | Should Be 60 (Get-Command $global:function).Parameters['Interval'].Attributes.Where{ $_ -is [ValidateRange] }.MinRange | Should -Be 60
} }
It "Interval Parameter should have a Max value of 2678400" { It "Interval Parameter should have a Max value of 2678400" {
(Get-Command $global:function).Parameters['Interval'].Attributes.Where{ $_ -is [ValidateRange] }.MaxRange | Should Be 2678400 (Get-Command $global:function).Parameters['Interval'].Attributes.Where{ $_ -is [ValidateRange] }.MaxRange | Should -Be 2678400
} }
} }
@@ -1,6 +1,6 @@
#Requires -Modules Pester #Requires -Modules Pester
$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) $global:here = (Split-Path -Parent $PSCommandPath)
$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] $global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0]
Describe $global:function -Tag 'Unit', 'Source', 'Built' { Describe $global:function -Tag 'Unit', 'Source', 'Built' {
@@ -37,17 +37,17 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' {
} }
default { default {
$true | Should be $false -Because "No Validation Selected. Review test cases" $true | Should -Be $false -Because "No Validation Selected. Review test cases"
} }
} }
} }
It "Interval Parameter should have a Min value of 60" { It "Interval Parameter should have a Min value of 60" {
(Get-Command $global:function).Parameters['Interval'].Attributes.Where{ $_ -is [ValidateRange] }.MinRange | Should Be 60 (Get-Command $global:function).Parameters['Interval'].Attributes.Where{ $_ -is [ValidateRange] }.MinRange | Should -Be 60
} }
It "Interval Parameter should have a Max value of 2678400" { It "Interval Parameter should have a Max value of 2678400" {
(Get-Command $global:function).Parameters['Interval'].Attributes.Where{ $_ -is [ValidateRange] }.MaxRange | Should Be 2678400 (Get-Command $global:function).Parameters['Interval'].Attributes.Where{ $_ -is [ValidateRange] }.MaxRange | Should -Be 2678400
} }
} }
+3 -3
View File
@@ -1,6 +1,6 @@
#Requires -Modules Pester #Requires -Modules Pester
$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) $global:here = (Split-Path -Parent $PSCommandPath)
$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] $global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0]
Describe $global:function -Tag 'Unit', 'Source', 'Built' { Describe $global:function -Tag 'Unit', 'Source', 'Built' {
@@ -36,7 +36,7 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' {
} }
default { default {
$true | Should be $false -Because "No Validation Selected. Review test cases" $true | Should -Be $false -Because "No Validation Selected. Review test cases"
} }
} }
} }
@@ -1,6 +1,6 @@
#Requires -Modules Pester #Requires -Modules Pester
$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) $global:here = (Split-Path -Parent $PSCommandPath)
$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] $global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0]
Describe $global:function -Tag 'Unit', 'Source', 'Built' { Describe $global:function -Tag 'Unit', 'Source', 'Built' {
@@ -36,7 +36,7 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' {
} }
default { default {
$true | Should be $false -Because "No Validation Selected. Review test cases" $true | Should -Be $false -Because "No Validation Selected. Review test cases"
} }
} }
} }
@@ -1,6 +1,6 @@
#Requires -Modules Pester #Requires -Modules Pester
$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) $global:here = (Split-Path -Parent $PSCommandPath)
$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] $global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0]
Describe $global:function -Tag 'Unit', 'Source', 'Built' { Describe $global:function -Tag 'Unit', 'Source', 'Built' {
@@ -35,17 +35,17 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' {
} }
default { default {
$true | Should be $false -Because "No Validation Selected. Review test cases" $true | Should -Be $false -Because "No Validation Selected. Review test cases"
} }
} }
} }
It "Interval Parameter should have a Min value of 60" { It "Interval Parameter should have a Min value of 60" {
(Get-Command $global:function).Parameters['Interval'].Attributes.Where{ $_ -is [ValidateRange] }.MinRange | Should Be 60 (Get-Command $global:function).Parameters['Interval'].Attributes.Where{ $_ -is [ValidateRange] }.MinRange | Should -Be 60
} }
It "Interval Parameter should have a Max value of 2678400" { It "Interval Parameter should have a Max value of 2678400" {
(Get-Command $global:function).Parameters['Interval'].Attributes.Where{ $_ -is [ValidateRange] }.MaxRange | Should Be 2678400 (Get-Command $global:function).Parameters['Interval'].Attributes.Where{ $_ -is [ValidateRange] }.MaxRange | Should -Be 2678400
} }
} }
@@ -1,6 +1,6 @@
#Requires -Modules Pester #Requires -Modules Pester
$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) $global:here = (Split-Path -Parent $PSCommandPath)
$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] $global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0]
Describe $global:function -Tag 'Unit', 'Source', 'Built' { Describe $global:function -Tag 'Unit', 'Source', 'Built' {
@@ -35,17 +35,17 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' {
} }
default { default {
$true | Should be $false -Because "No Validation Selected. Review test cases" $true | Should -Be $false -Because "No Validation Selected. Review test cases"
} }
} }
} }
It "Interval Parameter should have a Min value of 60" { It "Interval Parameter should have a Min value of 60" {
(Get-Command $global:function).Parameters['Interval'].Attributes.Where{ $_ -is [ValidateRange] }.MinRange | Should Be 60 (Get-Command $global:function).Parameters['Interval'].Attributes.Where{ $_ -is [ValidateRange] }.MinRange | Should -Be 60
} }
It "Interval Parameter should have a Max value of 2678400" { It "Interval Parameter should have a Max value of 2678400" {
(Get-Command $global:function).Parameters['Interval'].Attributes.Where{ $_ -is [ValidateRange] }.MaxRange | Should Be 2678400 (Get-Command $global:function).Parameters['Interval'].Attributes.Where{ $_ -is [ValidateRange] }.MaxRange | Should -Be 2678400
} }
} }
+3 -3
View File
@@ -1,6 +1,6 @@
#Requires -Modules Pester #Requires -Modules Pester
$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) $global:here = (Split-Path -Parent $PSCommandPath)
$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] $global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0]
Describe $global:function -Tag 'Unit', 'Source', 'Built' { Describe $global:function -Tag 'Unit', 'Source', 'Built' {
@@ -34,7 +34,7 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' {
} }
default { default {
$true | Should be $false -Because "No Validation Selected. Review test cases" $true | Should -Be $false -Because "No Validation Selected. Review test cases"
} }
} }
} }
@@ -1,6 +1,6 @@
#Requires -Modules Pester #Requires -Modules Pester
$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) $global:here = (Split-Path -Parent $PSCommandPath)
$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] $global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0]
Describe $global:function -Tag 'Unit', 'Source', 'Built' { Describe $global:function -Tag 'Unit', 'Source', 'Built' {
@@ -34,7 +34,7 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' {
} }
default { default {
$true | Should be $false -Because "No Validation Selected. Review test cases" $true | Should -Be $false -Because "No Validation Selected. Review test cases"
} }
} }
} }
@@ -1,6 +1,6 @@
#Requires -Modules Pester #Requires -Modules Pester
$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) $global:here = (Split-Path -Parent $PSCommandPath)
$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] $global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0]
Describe $global:function -Tag 'Unit', 'Source', 'Built' { Describe $global:function -Tag 'Unit', 'Source', 'Built' {
@@ -42,7 +42,7 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' {
} }
default { default {
$true | Should be $false -Because "No Validation Selected. Review test cases" $true | Should -Be $false -Because "No Validation Selected. Review test cases"
} }
} }
} }
@@ -1,6 +1,6 @@
#Requires -Modules Pester #Requires -Modules Pester
$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) $global:here = (Split-Path -Parent $PSCommandPath)
$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] $global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0]
Describe $global:function -Tag 'Unit', 'Source', 'Built' { Describe $global:function -Tag 'Unit', 'Source', 'Built' {
@@ -42,7 +42,7 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' {
} }
default { default {
$true | Should be $false -Because "No Validation Selected. Review test cases" $true | Should -Be $false -Because "No Validation Selected. Review test cases"
} }
} }
} }
+3 -3
View File
@@ -1,6 +1,6 @@
#Requires -Modules Pester #Requires -Modules Pester
$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) $global:here = (Split-Path -Parent $PSCommandPath)
$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] $global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0]
Describe $global:function -Tag 'Unit', 'Source', 'Built' { Describe $global:function -Tag 'Unit', 'Source', 'Built' {
@@ -27,7 +27,7 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' {
} }
default { default {
$true | Should be $false -Because "No Validation Selected. Review test cases" $true | Should -Be $false -Because "No Validation Selected. Review test cases"
} }
} }
} }
@@ -1,6 +1,6 @@
#Requires -Modules Pester #Requires -Modules Pester
$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) $global:here = (Split-Path -Parent $PSCommandPath)
$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] $global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0]
Describe $global:function -Tag 'Unit', 'Source', 'Built' { Describe $global:function -Tag 'Unit', 'Source', 'Built' {
@@ -42,7 +42,7 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' {
} }
default { default {
$true | Should be $false -Because "No Validation Selected. Review test cases" $true | Should -Be $false -Because "No Validation Selected. Review test cases"
} }
} }
} }
@@ -1,6 +1,6 @@
#Requires -Modules Pester #Requires -Modules Pester
$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) $global:here = (Split-Path -Parent $PSCommandPath)
$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] $global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0]
Describe $global:function -Tag 'Unit', 'Source', 'Built' { Describe $global:function -Tag 'Unit', 'Source', 'Built' {
@@ -41,7 +41,7 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' {
} }
default { default {
$true | Should be $false -Because "No Validation Selected. Review test cases" $true | Should -Be $false -Because "No Validation Selected. Review test cases"
} }
} }
} }
@@ -1,6 +1,6 @@
#Requires -Modules Pester #Requires -Modules Pester
$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) $global:here = (Split-Path -Parent $PSCommandPath)
$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] $global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0]
Describe $global:function -Tag 'Unit', 'Source', 'Built' { Describe $global:function -Tag 'Unit', 'Source', 'Built' {
@@ -41,7 +41,7 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' {
} }
default { default {
$true | Should be $false -Because "No Validation Selected. Review test cases" $true | Should -Be $false -Because "No Validation Selected. Review test cases"
} }
} }
} }
+2 -2
View File
@@ -1,6 +1,6 @@
#Requires -Modules Pester #Requires -Modules Pester
$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) $global:here = (Split-Path -Parent $PSCommandPath)
$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] $global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0]
Describe $global:function -Tag 'Unit', 'Source', 'Built' { Describe $global:function -Tag 'Unit', 'Source', 'Built' {
@@ -1,6 +1,6 @@
#Requires -Modules Pester #Requires -Modules Pester
$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) $global:here = (Split-Path -Parent $PSCommandPath)
$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] $global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0]
Describe $global:function -Tag 'Unit', 'Source', 'Built' { Describe $global:function -Tag 'Unit', 'Source', 'Built' {
@@ -1,6 +1,6 @@
#Requires -Modules Pester #Requires -Modules Pester
$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) $global:here = (Split-Path -Parent $PSCommandPath)
$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] $global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0]
Describe $global:function -Tag 'Unit', 'Source', 'Built' { Describe $global:function -Tag 'Unit', 'Source', 'Built' {
@@ -29,7 +29,7 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' {
} }
default { default {
$true | Should be $false -Because "No Validation Selected. Review test cases" $true | Should -Be $false -Because "No Validation Selected. Review test cases"
} }
} }
} }
+5 -5
View File
@@ -1,6 +1,6 @@
#Requires -Modules Pester #Requires -Modules Pester
$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) $global:here = (Split-Path -Parent $PSCommandPath)
$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] $global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0]
Describe $global:function -Tag 'Unit', 'Source', 'Built' { Describe $global:function -Tag 'Unit', 'Source', 'Built' {
@@ -35,17 +35,17 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' {
} }
default { default {
$true | Should be $false -Because "No Validation Selected. Review test cases" $true | Should -Be $false -Because "No Validation Selected. Review test cases"
} }
} }
} }
It "Interval Parameter should have a Min value of 60" { It "Interval Parameter should have a Min value of 60" {
(Get-Command $global:function).Parameters['Interval'].Attributes.Where{ $_ -is [ValidateRange] }.MinRange | Should Be 60 (Get-Command $global:function).Parameters['Interval'].Attributes.Where{ $_ -is [ValidateRange] }.MinRange | Should -Be 60
} }
It "Interval Parameter should have a Max value of 2678400" { It "Interval Parameter should have a Max value of 2678400" {
(Get-Command $global:function).Parameters['Interval'].Attributes.Where{ $_ -is [ValidateRange] }.MaxRange | Should Be 2678400 (Get-Command $global:function).Parameters['Interval'].Attributes.Where{ $_ -is [ValidateRange] }.MaxRange | Should -Be 2678400
} }
} }
+3 -3
View File
@@ -1,6 +1,6 @@
#Requires -Modules Pester #Requires -Modules Pester
$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) $global:here = (Split-Path -Parent $PSCommandPath)
$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] $global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0]
Describe $global:function -Tag 'Unit', 'Source', 'Built' { Describe $global:function -Tag 'Unit', 'Source', 'Built' {
@@ -29,7 +29,7 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' {
} }
default { default {
$true | Should be $false -Because "No Validation Selected. Review test cases" $true | Should -Be $false -Because "No Validation Selected. Review test cases"
} }
} }
} }
+3 -3
View File
@@ -1,6 +1,6 @@
#Requires -Modules Pester #Requires -Modules Pester
$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) $global:here = (Split-Path -Parent $PSCommandPath)
$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] $global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0]
Describe $global:function -Tag 'Unit', 'Source', 'Built' { Describe $global:function -Tag 'Unit', 'Source', 'Built' {
@@ -29,7 +29,7 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' {
} }
default { default {
$true | Should be $false -Because "No Validation Selected. Review test cases" $true | Should -Be $false -Because "No Validation Selected. Review test cases"
} }
} }
} }
@@ -1,6 +1,6 @@
#Requires -Modules Pester #Requires -Modules Pester
$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) $global:here = (Split-Path -Parent $PSCommandPath)
$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] $global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0]
Describe $global:function -Tag 'Unit', 'Source', 'Built' { Describe $global:function -Tag 'Unit', 'Source', 'Built' {
@@ -29,7 +29,7 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' {
} }
default { default {
$true | Should be $false -Because "No Validation Selected. Review test cases" $true | Should -Be $false -Because "No Validation Selected. Review test cases"
} }
} }
} }
+3 -3
View File
@@ -1,6 +1,6 @@
#Requires -Modules Pester #Requires -Modules Pester
$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) $global:here = (Split-Path -Parent $PSCommandPath)
$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] $global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0]
Describe $global:function -Tag 'Unit', 'Source', 'Built' { Describe $global:function -Tag 'Unit', 'Source', 'Built' {
@@ -29,7 +29,7 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' {
} }
default { default {
$true | Should be $false -Because "No Validation Selected. Review test cases" $true | Should -Be $false -Because "No Validation Selected. Review test cases"
} }
} }
} }
+3 -3
View File
@@ -1,6 +1,6 @@
#Requires -Modules Pester #Requires -Modules Pester
$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) $global:here = (Split-Path -Parent $PSCommandPath)
$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] $global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0]
Describe $global:function -Tag 'Unit', 'Source', 'Built' { Describe $global:function -Tag 'Unit', 'Source', 'Built' {
@@ -14,7 +14,7 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' {
} }
It "zOrgIdentifier has the NotNullOrEmpty Validator" { It "zOrgIdentifier has the NotNullOrEmpty Validator" {
(Get-Command $global:function).Parameters['zOrgIdentifier'].Attributes.Where{ $_ -is [ValidateNotNullOrEmpty] }.Count | Should Be 1 (Get-Command $global:function).Parameters['zOrgIdentifier'].Attributes.Where{ $_ -is [ValidateNotNullOrEmpty] }.Count | Should -Be 1
} }
} }
+3 -3
View File
@@ -1,6 +1,6 @@
#Requires -Modules Pester #Requires -Modules Pester
$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) $global:here = (Split-Path -Parent $PSCommandPath)
$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] $global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0]
Describe $global:function -Tag 'Unit', 'Source', 'Built' { Describe $global:function -Tag 'Unit', 'Source', 'Built' {
@@ -29,7 +29,7 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' {
} }
default { default {
$true | Should be $false -Because "No Validation Selected. Review test cases" $true | Should -Be $false -Because "No Validation Selected. Review test cases"
} }
} }
} }
+3 -3
View File
@@ -1,6 +1,6 @@
#Requires -Modules Pester #Requires -Modules Pester
$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) $global:here = (Split-Path -Parent $PSCommandPath)
$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] $global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0]
Describe $global:function -Tag 'Unit', 'Source', 'Built' { Describe $global:function -Tag 'Unit', 'Source', 'Built' {
@@ -27,7 +27,7 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' {
} }
default { default {
$true | Should be $false -Because "No Validation Selected. Review test cases" $true | Should -Be $false -Because "No Validation Selected. Review test cases"
} }
} }
} }
+5 -5
View File
@@ -1,6 +1,6 @@
#Requires -Modules Pester #Requires -Modules Pester
$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) $global:here = (Split-Path -Parent $PSCommandPath)
$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] $global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0]
Describe $global:function -Tag 'Unit', 'Source', 'Built' { Describe $global:function -Tag 'Unit', 'Source', 'Built' {
@@ -34,17 +34,17 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' {
} }
default { default {
$true | Should be $false -Because "No Validation Selected. Review test cases" $true | Should -Be $false -Because "No Validation Selected. Review test cases"
} }
} }
} }
It "Interval Parameter should have a Min value of 1" { It "Interval Parameter should have a Min value of 1" {
(Get-Command $global:function).Parameters['limitTo'].Attributes.Where{ $_ -is [ValidateRange] }.MinRange | Should Be 1 (Get-Command $global:function).Parameters['limitTo'].Attributes.Where{ $_ -is [ValidateRange] }.MinRange | Should -Be 1
} }
It "Interval Parameter should have a Max value of 1000000" { It "Interval Parameter should have a Max value of 1000000" {
(Get-Command $global:function).Parameters['limitTo'].Attributes.Where{ $_ -is [ValidateRange] }.MaxRange | Should Be 1000000 (Get-Command $global:function).Parameters['limitTo'].Attributes.Where{ $_ -is [ValidateRange] }.MaxRange | Should -Be 1000000
} }
} }
+3 -3
View File
@@ -1,6 +1,6 @@
#Requires -Modules Pester #Requires -Modules Pester
$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) $global:here = (Split-Path -Parent $PSCommandPath)
$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] $global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0]
Describe $global:function -Tag 'Unit', 'Source', 'Built' { Describe $global:function -Tag 'Unit', 'Source', 'Built' {
@@ -30,7 +30,7 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' {
} }
default { default {
$true | Should be $false -Because "No Validation Selected. Review test cases" $true | Should -Be $false -Because "No Validation Selected. Review test cases"
} }
} }
} }
+3 -3
View File
@@ -1,6 +1,6 @@
#Requires -Modules Pester #Requires -Modules Pester
$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) $global:here = (Split-Path -Parent $PSCommandPath)
$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] $global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0]
Describe $global:function -Tag 'Unit', 'Source', 'Built' { Describe $global:function -Tag 'Unit', 'Source', 'Built' {
@@ -28,7 +28,7 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' {
} }
default { default {
$true | Should be $false -Because "No Validation Selected. Review test cases" $true | Should -Be $false -Because "No Validation Selected. Review test cases"
} }
} }
} }
+2 -2
View File
@@ -1,6 +1,6 @@
#Requires -Modules Pester #Requires -Modules Pester
$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) $global:here = (Split-Path -Parent $PSCommandPath)
$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] $global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0]
Describe $global:function -Tag 'Unit', 'Source', 'Built' { Describe $global:function -Tag 'Unit', 'Source', 'Built' {
+2 -2
View File
@@ -1,6 +1,6 @@
#Requires -Modules Pester #Requires -Modules Pester
$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) $global:here = (Split-Path -Parent $PSCommandPath)
$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] $global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0]
Describe $global:function -Tag 'Unit', 'Source', 'Built' { Describe $global:function -Tag 'Unit', 'Source', 'Built' {
+3 -3
View File
@@ -1,6 +1,6 @@
#Requires -Modules Pester #Requires -Modules Pester
$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) $global:here = (Split-Path -Parent $PSCommandPath)
$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] $global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0]
Describe $global:function -Tag 'Unit', 'Source', 'Built' { Describe $global:function -Tag 'Unit', 'Source', 'Built' {
@@ -12,7 +12,7 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' {
} }
It "datastoreIdentifier parameter does not take null or empty values" { It "datastoreIdentifier parameter does not take null or empty values" {
(Get-Command $global:function).Parameters['datastoreIdentifier'].Attributes.Where{ $_ -is [ValidateNotNullOrEmpty] }.count | Should Be 1 (Get-Command $global:function).Parameters['datastoreIdentifier'].Attributes.Where{ $_ -is [ValidateNotNullOrEmpty] }.count | Should -Be 1
} }
} }
+6 -6
View File
@@ -1,6 +1,6 @@
#Requires -Modules Pester #Requires -Modules Pester
$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) $global:here = (Split-Path -Parent $PSCommandPath)
$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] $global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0]
Describe $global:function -Tag 'Unit', 'Source', 'Built' { Describe $global:function -Tag 'Unit', 'Source', 'Built' {
@@ -53,13 +53,13 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' {
} }
default { default {
$true | Should be $false -Because "No Validation Selected. Review test cases" $true | Should -Be $false -Because "No Validation Selected. Review test cases"
} }
} }
} }
It "entityType parameter only accecpts 4 different values" { It "entityType parameter only accecpts 4 different values" {
(Get-Command $global:function).Parameters['entityType'].Attributes.Where{ $_ -is [ValidateSet] }.ValidValues.Count | Should be 4 (Get-Command $global:function).Parameters['entityType'].Attributes.Where{ $_ -is [ValidateSet] }.ValidValues.Count | Should -Be 4
} }
It "entityType parameter accecpts 'VPG' as a Value" { It "entityType parameter accecpts 'VPG' as a Value" {
@@ -79,7 +79,7 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' {
} }
It "category parameter only accecpts 3 different values" { It "category parameter only accecpts 3 different values" {
(Get-Command $global:function).Parameters['category'].Attributes.Where{ $_ -is [ValidateSet] }.ValidValues.Count | Should be 3 (Get-Command $global:function).Parameters['category'].Attributes.Where{ $_ -is [ValidateSet] }.ValidValues.Count | Should -Be 3
} }
It "category parameter accecpts 'All' as a Value" { It "category parameter accecpts 'All' as a Value" {
@@ -95,7 +95,7 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' {
} }
It "eventCategory parameter only accecpts 3 different values" { It "eventCategory parameter only accecpts 3 different values" {
(Get-Command $global:function).Parameters['eventCategory'].Attributes.Where{ $_ -is [ValidateSet] }.ValidValues.Count | Should be 3 (Get-Command $global:function).Parameters['eventCategory'].Attributes.Where{ $_ -is [ValidateSet] }.ValidValues.Count | Should -Be 3
} }
It "eventCategory parameter accecpts 'All' as a Value" { It "eventCategory parameter accecpts 'All' as a Value" {
+2 -2
View File
@@ -1,6 +1,6 @@
#Requires -Modules Pester #Requires -Modules Pester
$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) $global:here = (Split-Path -Parent $PSCommandPath)
$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] $global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0]
Describe $global:function -Tag 'Unit', 'Source', 'Built' { Describe $global:function -Tag 'Unit', 'Source', 'Built' {
+2 -2
View File
@@ -1,6 +1,6 @@
#Requires -Modules Pester #Requires -Modules Pester
$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) $global:here = (Split-Path -Parent $PSCommandPath)
$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] $global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0]
Describe $global:function -Tag 'Unit', 'Source', 'Built' { Describe $global:function -Tag 'Unit', 'Source', 'Built' {
+3 -3
View File
@@ -1,6 +1,6 @@
#Requires -Modules Pester #Requires -Modules Pester
$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) $global:here = (Split-Path -Parent $PSCommandPath)
$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] $global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0]
Describe $global:function -Tag 'Unit', 'Source', 'Built' { Describe $global:function -Tag 'Unit', 'Source', 'Built' {
@@ -38,7 +38,7 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' {
} }
default { default {
$true | Should be $false -Because "No Validation Selected. Review test cases" $true | Should -Be $false -Because "No Validation Selected. Review test cases"
} }
} }
} }
+2 -2
View File
@@ -1,6 +1,6 @@
#Requires -Modules Pester #Requires -Modules Pester
$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) $global:here = (Split-Path -Parent $PSCommandPath)
$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] $global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0]
Describe $global:function -Tag 'Unit', 'Source', 'Built' { Describe $global:function -Tag 'Unit', 'Source', 'Built' {
@@ -1,6 +1,6 @@
#Requires -Modules Pester #Requires -Modules Pester
$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) $global:here = (Split-Path -Parent $PSCommandPath)
$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] $global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0]
Describe $global:function -Tag 'Unit', 'Source', 'Built' { Describe $global:function -Tag 'Unit', 'Source', 'Built' {
@@ -1,6 +1,6 @@
#Requires -Modules Pester #Requires -Modules Pester
$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) $global:here = (Split-Path -Parent $PSCommandPath)
$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] $global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0]
Describe $global:function -Tag 'Unit', 'Source', 'Built' { Describe $global:function -Tag 'Unit', 'Source', 'Built' {
@@ -1,6 +1,6 @@
#Requires -Modules Pester #Requires -Modules Pester
$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) $global:here = (Split-Path -Parent $PSCommandPath)
$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] $global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0]
Describe $global:function -Tag 'Unit', 'Source', 'Built' { Describe $global:function -Tag 'Unit', 'Source', 'Built' {
+2 -2
View File
@@ -1,6 +1,6 @@
#Requires -Modules Pester #Requires -Modules Pester
$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) $global:here = (Split-Path -Parent $PSCommandPath)
$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] $global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0]
Describe $global:function -Tag 'Unit', 'Source', 'Built' { Describe $global:function -Tag 'Unit', 'Source', 'Built' {
@@ -1,6 +1,6 @@
#Requires -Modules Pester #Requires -Modules Pester
$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) $global:here = (Split-Path -Parent $PSCommandPath)
$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] $global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0]
Describe $global:function -Tag 'Unit', 'Source', 'Built' { Describe $global:function -Tag 'Unit', 'Source', 'Built' {
@@ -1,6 +1,6 @@
#Requires -Modules Pester #Requires -Modules Pester
$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) $global:here = (Split-Path -Parent $PSCommandPath)
$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).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 {
@@ -59,7 +59,7 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' {
} }
Context "$global:function::Parameter Functional Tests" { Context "$global:function::Parameter Functional Tests" {
Mock -ModuleName ZertoApiWrapper -CommandName Invoke-ZertoRestRequest -ParameterFilter { Mock -ModuleName ZertoApiWrapper -CommandName Invoke-ZertoRestRequest -ParameterFilter {
$uri -eq 'virtualizationsites' $uri -eq 'virtualizationsites'
} { } {
return (Get-Content "$global:here\Mocks\VirtualSite-NoParams.json" -Raw) | ConvertFrom-Json return (Get-Content "$global:here\Mocks\VirtualSite-NoParams.json" -Raw) | ConvertFrom-Json
+2 -2
View File
@@ -1,6 +1,6 @@
#Requires -Modules Pester #Requires -Modules Pester
$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) $global:here = (Split-Path -Parent $PSCommandPath)
$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] $global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0]
Describe $global:function -Tag 'Unit', 'Source', 'Built' { Describe $global:function -Tag 'Unit', 'Source', 'Built' {
+2 -2
View File
@@ -1,6 +1,6 @@
#Requires -Modules Pester #Requires -Modules Pester
$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) $global:here = (Split-Path -Parent $PSCommandPath)
$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] $global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0]
Describe $global:function -Tag 'Unit', 'Source', 'Built' { Describe $global:function -Tag 'Unit', 'Source', 'Built' {
+2 -2
View File
@@ -1,6 +1,6 @@
#Requires -Modules Pester #Requires -Modules Pester
$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) $global:here = (Split-Path -Parent $PSCommandPath)
$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] $global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0]
Describe $global:function -Tag 'Unit', 'Source', 'Built' { Describe $global:function -Tag 'Unit', 'Source', 'Built' {
+2 -2
View File
@@ -1,6 +1,6 @@
#Requires -Modules Pester #Requires -Modules Pester
$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) $global:here = (Split-Path -Parent $PSCommandPath)
$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] $global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0]
Describe $global:function -Tag 'Unit', 'Source', 'Built' { Describe $global:function -Tag 'Unit', 'Source', 'Built' {
+2 -2
View File
@@ -1,6 +1,6 @@
#Requires -Modules Pester #Requires -Modules Pester
$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) $global:here = (Split-Path -Parent $PSCommandPath)
$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] $global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0]
Describe $global:function -Tag 'Unit', 'Source', 'Built' { Describe $global:function -Tag 'Unit', 'Source', 'Built' {
+2 -2
View File
@@ -1,6 +1,6 @@
#Requires -Modules Pester #Requires -Modules Pester
$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) $global:here = (Split-Path -Parent $PSCommandPath)
$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] $global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0]
Describe $global:function -Tag 'Unit', 'Source', 'Built' { Describe $global:function -Tag 'Unit', 'Source', 'Built' {
@@ -1,12 +1,12 @@
#Requires -Modules Pester #Requires -Modules Pester
$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) $global:here = (Split-Path -Parent $PSCommandPath)
$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] $global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0]
Describe $global:function -Tag 'Unit', 'Source', 'Built' { Describe $global:function -Tag 'Unit', 'Source', 'Built' {
Context "$global:function::Parameter Unit Tests" { Context "$global:function::Parameter Unit Tests" {
it "$global:function should have exactly 11 parameters defined" { It "$global:function should have exactly 11 parameters defined" {
(get-command $global:function).Parameters.Count | Should -Be 14 (Get-Command $global:function).Parameters.Count | Should -Be 14
} }
It "Has a mandatory string array parameter for the settings file to import" { It "Has a mandatory string array parameter for the settings file to import" {
+4 -4
View File
@@ -1,12 +1,12 @@
#Requires -Modules Pester #Requires -Modules Pester
$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) $global:here = (Split-Path -Parent $PSCommandPath)
$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] $global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0]
Describe $global:function -Tag 'Unit', 'Source', 'Built' { Describe $global:function -Tag 'Unit', 'Source', 'Built' {
Context "$global:function::Parameter Unit Tests" { Context "$global:function::Parameter Unit Tests" {
it "$global:function should have exactly 12 parameters defined" { It "$global:function should have exactly 12 parameters defined" {
(get-command $global:function).Parameters.Count | Should -Be 12 (Get-Command $global:function).Parameters.Count | Should -Be 12
} }
It "Has a mandatory string array parameter for the settings file to import" { It "Has a mandatory string array parameter for the settings file to import" {
+2 -2
View File
@@ -1,6 +1,6 @@
#Requires -Modules Pester #Requires -Modules Pester
$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) $global:here = (Split-Path -Parent $PSCommandPath)
$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] $global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0]
Describe $global:function -Tag 'Unit', 'Source', 'Built' { Describe $global:function -Tag 'Unit', 'Source', 'Built' {
+3 -3
View File
@@ -1,6 +1,6 @@
#Requires -Modules Pester #Requires -Modules Pester
$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) $global:here = (Split-Path -Parent $PSCommandPath)
$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] $global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0]
Describe $global:function -Tag 'Unit', 'Source', 'Built' { Describe $global:function -Tag 'Unit', 'Source', 'Built' {
@@ -63,7 +63,7 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' {
} }
It "runs when called" { It "runs when called" {
Invoke-ZARestRequest -uri "myuri" | Should Be "Ran Command" Invoke-ZARestRequest -uri "myuri" | Should -Be "Ran Command"
} }
It "throws when the last action was over 60 minutes ago" { It "throws when the last action was over 60 minutes ago" {
@@ -1,6 +1,6 @@
#Requires -Modules Pester #Requires -Modules Pester
$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) $global:here = (Split-Path -Parent $PSCommandPath)
$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] $global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0]
Describe $global:function -Tag 'Unit', 'Source', 'Built' { Describe $global:function -Tag 'Unit', 'Source', 'Built' {
+7 -7
View File
@@ -1,12 +1,12 @@
#Requires -Modules Pester #Requires -Modules Pester
$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) $global:here = (Split-Path -Parent $PSCommandPath)
$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] $global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0]
Describe $global:function -Tag 'Unit', 'Source', 'Built' { Describe $global:function -Tag 'Unit', 'Source', 'Built' {
Context "$global:function::Parameter Unit Tests" { Context "$global:function::Parameter Unit Tests" {
it "$global:function should have exactly 20 parameters defined" { It "$global:function should have exactly 20 parameters defined" {
(get-command $global:function).Parameters.Count | Should -Be 20 (Get-Command $global:function).Parameters.Count | Should -Be 20
} }
$ParameterTestCases = @( $ParameterTestCases = @(
@@ -55,7 +55,7 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' {
} }
default { default {
$true | should be $false -Because "No Validation Selected. Review test cases" $true | Should -Be $false -Because "No Validation Selected. Review test cases"
} }
} }
} }
@@ -82,11 +82,11 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' {
(Get-Command $global:function).Parameters['shutdownPolicy'].Attributes.Where{ $_ -is [ValidateSet] }.ValidValues | Should -Contain 2 (Get-Command $global:function).Parameters['shutdownPolicy'].Attributes.Where{ $_ -is [ValidateSet] }.ValidValues | Should -Contain 2
} }
it "Time to wait before shutdown in sec should have a default value of 3600" { It "Time to wait before shutdown in sec should have a default value of 3600" {
Get-Command $global:function | Should -HaveParameter timeToWaitBeforeShutdownInSec -DefaultValue 3600 Get-Command $global:function | Should -HaveParameter timeToWaitBeforeShutdownInSec -DefaultValue 3600
} }
it "Time to wait before shutdown in sec should have a minimum value of 300 and max value of 86400" { It "Time to wait before shutdown in sec should have a minimum value of 300 and max value of 86400" {
(Get-Command $global:function).Parameters['timeToWaitBeforeShutdownInSec'].Attributes.Where{ $_ -is [ValidateRange] }.MinRange | Should -Be 300 (Get-Command $global:function).Parameters['timeToWaitBeforeShutdownInSec'].Attributes.Where{ $_ -is [ValidateRange] }.MinRange | Should -Be 300
(Get-Command $global:function).Parameters['timeToWaitBeforeShutdownInSec'].Attributes.Where{ $_ -is [ValidateRange] }.MaxRange | Should -Be 86400 (Get-Command $global:function).Parameters['timeToWaitBeforeShutdownInSec'].Attributes.Where{ $_ -is [ValidateRange] }.MaxRange | Should -Be 86400
} }
@@ -1,13 +1,13 @@
#Requires -Modules Pester #Requires -Modules Pester
$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) $global:here = (Split-Path -Parent $PSCommandPath)
$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] $global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0]
Describe $global:function -Tag 'Unit', 'Source', 'Built' { Describe $global:function -Tag 'Unit', 'Source', 'Built' {
Context "$global:function::Parameter Unit Tests" { Context "$global:function::Parameter Unit Tests" {
it "$global:function should have exactly 15 parameters defined" { It "$global:function should have exactly 15 parameters defined" {
(get-command $global:function).Parameters.Count | Should -Be 15 (Get-Command $global:function).Parameters.Count | Should -Be 15
} }
$ParameterTestCases = @( $ParameterTestCases = @(
@@ -41,7 +41,7 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' {
} }
default { default {
$true | should be $false -Because "No Validation Selected. Review test cases" $true | Should -Be $false -Because "No Validation Selected. Review test cases"
} }
} }
} }
@@ -1,16 +1,16 @@
#Requires -Modules Pester #Requires -Modules Pester
$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) $global:here = (Split-Path -Parent $PSCommandPath)
$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] $global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0]
Describe $global:function -Tag 'Unit', 'Source', 'Built' { Describe $global:function -Tag 'Unit', 'Source', 'Built' {
Context "$global:function::Parameter Unit Tests" { Context "$global:function::Parameter Unit Tests" {
it "$global:function should have exactly 12 parameters defined" { It "$global:function should have exactly 12 parameters defined" {
(get-command $global:function).Parameters.Count | Should -Be 12 (Get-Command $global:function).Parameters.Count | Should -Be 12
} }
it "has a mandatory string parameter for the vpgName" { It "has a mandatory string parameter for the vpgName" {
Get-Command $global:function | Should -HaveParameter vpgName Get-Command $global:function | Should -HaveParameter vpgName
Get-Command $global:function | Should -HaveParameter vpgName -Type string[] Get-Command $global:function | Should -HaveParameter vpgName -Type string[]
Get-Command $global:function | Should -HaveParameter vpgName -Mandatory Get-Command $global:function | Should -HaveParameter vpgName -Mandatory
+5 -5
View File
@@ -1,16 +1,16 @@
#Requires -Modules Pester #Requires -Modules Pester
$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) $global:here = (Split-Path -Parent $PSCommandPath)
$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] $global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0]
Describe $global:function -Tag 'Unit', 'Source', 'Built' { Describe $global:function -Tag 'Unit', 'Source', 'Built' {
Context "$global:function::Parameter Unit Tests" { Context "$global:function::Parameter Unit Tests" {
it "$global:function should have exactly 12 parameters defined" { It "$global:function should have exactly 12 parameters defined" {
(get-command $global:function).Parameters.Count | Should -Be 12 (Get-Command $global:function).Parameters.Count | Should -Be 12
} }
it "has a mandatory string parameter for the vpgName" { It "has a mandatory string parameter for the vpgName" {
Get-Command $global:function | Should -HaveParameter vpgName Get-Command $global:function | Should -HaveParameter vpgName
Get-Command $global:function | Should -HaveParameter vpgName -Type string[] Get-Command $global:function | Should -HaveParameter vpgName -Type string[]
Get-Command $global:function | Should -HaveParameter vpgName -Mandatory Get-Command $global:function | Should -HaveParameter vpgName -Mandatory
+6 -6
View File
@@ -1,12 +1,12 @@
#Requires -Modules Pester #Requires -Modules Pester
$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) $global:here = (Split-Path -Parent $PSCommandPath)
$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] $global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0]
Describe $global:function -Tag 'Unit', 'Source', 'Built' { Describe $global:function -Tag 'Unit', 'Source', 'Built' {
Context "$global:function::Parameter Unit Tests" { Context "$global:function::Parameter Unit Tests" {
it "$global:function should have exactly 20 parameters defined" { It "$global:function should have exactly 20 parameters defined" {
(get-command $global:function).Parameters.Count | Should -Be 20 (Get-Command $global:function).Parameters.Count | Should -Be 20
} }
$ParameterTestCases = @( $ParameterTestCases = @(
@@ -55,7 +55,7 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' {
} }
default { default {
$true | should be $false -Because "No Validation Selected. Review test cases" $true | Should -Be $false -Because "No Validation Selected. Review test cases"
} }
} }
} }
@@ -67,7 +67,7 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' {
(Get-Command $global:function).Parameters['commitPolicy'].Attributes.Where{ $_ -is [ValidateSet] }.ValidValues | Should -Contain 'None' (Get-Command $global:function).Parameters['commitPolicy'].Attributes.Where{ $_ -is [ValidateSet] }.ValidValues | Should -Contain 'None'
} }
it "Commit Policy Timeout should have a minimum value of 300 and max value of 86400" { It "Commit Policy Timeout should have a minimum value of 300 and max value of 86400" {
(Get-Command $global:function).Parameters['commitPolicyTimeout'].Attributes.Where{ $_ -is [ValidateRange] }.MinRange | Should -Be 300 (Get-Command $global:function).Parameters['commitPolicyTimeout'].Attributes.Where{ $_ -is [ValidateRange] }.MinRange | Should -Be 300
(Get-Command $global:function).Parameters['commitPolicyTimeout'].Attributes.Where{ $_ -is [ValidateRange] }.MaxRange | Should -Be 86400 (Get-Command $global:function).Parameters['commitPolicyTimeout'].Attributes.Where{ $_ -is [ValidateRange] }.MaxRange | Should -Be 86400
} }
@@ -1,13 +1,13 @@
#Requires -Modules Pester #Requires -Modules Pester
$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) $global:here = (Split-Path -Parent $PSCommandPath)
$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] $global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0]
Describe $global:function -Tag 'Unit', 'Source', 'Built' { Describe $global:function -Tag 'Unit', 'Source', 'Built' {
Context "$global:function::Parameter Unit Tests" { Context "$global:function::Parameter Unit Tests" {
it "$global:function should have exactly 16 parameters defined" { It "$global:function should have exactly 16 parameters defined" {
(get-command $global:function).Parameters.Count | Should -Be 16 (Get-Command $global:function).Parameters.Count | Should -Be 16
} }
$ParameterTestCases = @( $ParameterTestCases = @(
@@ -41,7 +41,7 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' {
} }
default { default {
$true | should be $false -Because "No Validation Selected. Review test cases" $true | Should -Be $false -Because "No Validation Selected. Review test cases"
} }
} }
} }
@@ -1,16 +1,16 @@
#Requires -Modules Pester #Requires -Modules Pester
$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) $global:here = (Split-Path -Parent $PSCommandPath)
$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] $global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0]
Describe $global:function -Tag 'Unit', 'Source', 'Built' { Describe $global:function -Tag 'Unit', 'Source', 'Built' {
Context "$global:function::Parameter Unit Tests" { Context "$global:function::Parameter Unit Tests" {
it "$global:function should have exactly 14 parameters defined" { It "$global:function should have exactly 14 parameters defined" {
(get-command $global:function).Parameters.Count | Should -Be 14 (Get-Command $global:function).Parameters.Count | Should -Be 14
} }
it "has a mandatory string parameter for the vpgName" { It "has a mandatory string parameter for the vpgName" {
Get-Command $global:function | Should -HaveParameter vpgName Get-Command $global:function | Should -HaveParameter vpgName
Get-Command $global:function | Should -HaveParameter vpgName -Type string[] Get-Command $global:function | Should -HaveParameter vpgName -Type string[]
Get-Command $global:function | Should -HaveParameter vpgName -Mandatory Get-Command $global:function | Should -HaveParameter vpgName -Mandatory
@@ -1,6 +1,6 @@
#Requires -Modules Pester #Requires -Modules Pester
$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) $global:here = (Split-Path -Parent $PSCommandPath)
$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] $global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0]
Describe $global:function -Tag 'Unit', 'Source', 'Built' { Describe $global:function -Tag 'Unit', 'Source', 'Built' {
@@ -40,12 +40,12 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' {
It "<TestName> parameter cannot be null or empty" -TestCases $ParameterValidationTestCases { It "<TestName> parameter cannot be null or empty" -TestCases $ParameterValidationTestCases {
param($ParameterName) param($ParameterName)
$thisParameter = $thisCommand.Parameters[$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'" { It "Method parameter can only be 'GET', 'POST', 'PUT', 'DELETE'" {
$thisParameter = $thisCommand.Parameters['method'] $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 'GET' | Should -BeTrue
$thisParameter.Attributes.Where{ $_ -is [ValidateSet] }.validValues -contains 'PUT' | Should -BeTrue $thisParameter.Attributes.Where{ $_ -is [ValidateSet] }.validValues -contains 'PUT' | Should -BeTrue
$thisParameter.Attributes.Where{ $_ -is [ValidateSet] }.validValues -contains 'POST' | Should -BeTrue $thisParameter.Attributes.Where{ $_ -is [ValidateSet] }.validValues -contains 'POST' | Should -BeTrue
+2 -2
View File
@@ -1,6 +1,6 @@
#Requires -Modules Pester #Requires -Modules Pester
$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) $global:here = (Split-Path -Parent $PSCommandPath)
$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).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 {
+2 -2
View File
@@ -1,6 +1,6 @@
#Requires -Modules Pester #Requires -Modules Pester
$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) $global:here = (Split-Path -Parent $PSCommandPath)
$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] $global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0]
Describe $global:function -Tag 'Unit', 'Source', 'Built' { Describe $global:function -Tag 'Unit', 'Source', 'Built' {
@@ -1,6 +1,6 @@
#Requires -Modules Pester #Requires -Modules Pester
$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) $global:here = (Split-Path -Parent $PSCommandPath)
$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] $global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0]
Describe $global:function -Tag 'Unit', 'Source', 'Built' { Describe $global:function -Tag 'Unit', 'Source', 'Built' {
+2 -2
View File
@@ -1,6 +1,6 @@
#Requires -Modules Pester #Requires -Modules Pester
$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) $global:here = (Split-Path -Parent $PSCommandPath)
$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] $global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0]
Describe $global:function -Tag 'Unit', 'Source', 'Built' { Describe $global:function -Tag 'Unit', 'Source', 'Built' {
+2 -2
View File
@@ -1,6 +1,6 @@
#Requires -Modules Pester #Requires -Modules Pester
$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) $global:here = (Split-Path -Parent $PSCommandPath)
$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] $global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0]
Describe $global:function -Tag 'Unit', 'Source', 'Built' { Describe $global:function -Tag 'Unit', 'Source', 'Built' {
@@ -1,6 +1,6 @@
#Requires -Modules Pester #Requires -Modules Pester
$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) $global:here = (Split-Path -Parent $PSCommandPath)
$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] $global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0]
Describe $global:function -Tag 'Unit', 'Source', 'Built' { Describe $global:function -Tag 'Unit', 'Source', 'Built' {
+2 -2
View File
@@ -1,6 +1,6 @@
#Requires -Modules Pester #Requires -Modules Pester
$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) $global:here = (Split-Path -Parent $PSCommandPath)
$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] $global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0]
Describe $global:function -Tag 'Unit', 'Source', 'Built' { Describe $global:function -Tag 'Unit', 'Source', 'Built' {
+2 -2
View File
@@ -1,6 +1,6 @@
#Requires -Modules Pester #Requires -Modules Pester
$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) $global:here = (Split-Path -Parent $PSCommandPath)
$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] $global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0]
Describe $global:function -Tag 'Unit', 'Source', 'Built' { Describe $global:function -Tag 'Unit', 'Source', 'Built' {
+2 -2
View File
@@ -1,6 +1,6 @@
#Requires -Modules Pester #Requires -Modules Pester
$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) $global:here = (Split-Path -Parent $PSCommandPath)
$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] $global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0]
Describe $global:function -Tag 'Unit', 'Source', 'Built' { Describe $global:function -Tag 'Unit', 'Source', 'Built' {
+2 -2
View File
@@ -1,6 +1,6 @@
#Requires -Modules Pester #Requires -Modules Pester
$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) $global:here = (Split-Path -Parent $PSCommandPath)
$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] $global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0]
Describe $global:function -Tag 'Unit', 'Source', 'Built' { Describe $global:function -Tag 'Unit', 'Source', 'Built' {
@@ -1,6 +1,6 @@
#Requires -Modules Pester #Requires -Modules Pester
$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) $global:here = (Split-Path -Parent $PSCommandPath)
$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] $global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0]
Describe $global:function -Tag 'Unit', 'Source', 'Built' { Describe $global:function -Tag 'Unit', 'Source', 'Built' {
InModuleScope -ModuleName ZertoApiWrapper { InModuleScope -ModuleName ZertoApiWrapper {

Some files were not shown because too many files have changed in this diff Show More