diff --git a/Tests/Private/Get-Map.Tests.ps1 b/Tests/Private/Get-Map.Tests.ps1 index 8aeca06..040afda 100644 --- a/Tests/Private/Get-Map.Tests.ps1 +++ b/Tests/Private/Get-Map.Tests.ps1 @@ -1,45 +1,45 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { InModuleScope -ModuleName ZertoApiWrapper { 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 } - it "Input Object should not accecpt a Null or Empty value" { + It "Input Object should not accecpt a Null or Empty value" { $myObj = [PSCustomObject]@{ } { Get-Map -InputObject $myObj -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 } - 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 } - 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 } { Get-Map -InputObject $myObj -Key "" -Value "Value" } | Should Throw { Get-Map -InputObject $null -Key $null -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 } { 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 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 } - 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" } } @@ -49,15 +49,15 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { BeforeEach { $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 } - it "should return a hashtable with 3 entries" { - $myMap.count | should -Be 3 + It "should return a hashtable with 3 entries" { + $myMap.count | Should -Be 3 } - it "should be properly mapped" { + It "should be properly mapped" { $myMap["vmid.12"] | Should -Be "ExchangeMailbox" $myMap["vmid.13"] | Should -Be "ExchangeApplication" $myMap["vmid.14"] | Should -Be "ExchangeWeb" diff --git a/Tests/Private/Get-ZertoApiFilter.Tests.ps1 b/Tests/Private/Get-ZertoApiFilter.Tests.ps1 index a4b5978..ce0fbfb 100644 --- a/Tests/Private/Get-ZertoApiFilter.Tests.ps1 +++ b/Tests/Private/Get-ZertoApiFilter.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { @@ -16,7 +16,7 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { { 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" } } @@ -47,19 +47,19 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { } } - it "converts bool to text" { - Get-ZertoApiFilter -filtertable $singleBoolItemTest | should -Be "?BoolItem=True" + It "converts bool to text" { + Get-ZertoApiFilter -filtertable $singleBoolItemTest | Should -Be "?BoolItem=True" } - it "one item test" { - Get-ZertoApiFilter -filtertable $oneItemTest | should be "?OneItem=Test" + It "one item test" { + Get-ZertoApiFilter -filtertable $oneItemTest | Should -Be "?OneItem=Test" } - it "should ignore CommonParameters" { - Get-ZertoApiFilter -filtertable $commonParamTest | should be "?OneItem=Test" + It "should ignore CommonParameters" { + 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 | Should -match "^\?" $returnString | Should -match "&" diff --git a/Tests/Public/Add-ZertoPeerSite.Tests.ps1 b/Tests/Public/Add-ZertoPeerSite.Tests.ps1 index bdf4f52..60a9fd3 100644 --- a/Tests/Public/Add-ZertoPeerSite.Tests.ps1 +++ b/Tests/Public/Add-ZertoPeerSite.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { BeforeAll { @@ -43,7 +43,7 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { } 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" { - (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" { - (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'" { diff --git a/Tests/Public/Checkpoint-ZertoVpg.Tests.ps1 b/Tests/Public/Checkpoint-ZertoVpg.Tests.ps1 index 7ae3eea..4fbb862 100644 --- a/Tests/Public/Checkpoint-ZertoVpg.Tests.ps1 +++ b/Tests/Public/Checkpoint-ZertoVpg.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { BeforeAll { diff --git a/Tests/Public/Connect-ZertoAnalytics.Tests.ps1 b/Tests/Public/Connect-ZertoAnalytics.Tests.ps1 index 661e985..d91ed80 100644 --- a/Tests/Public/Connect-ZertoAnalytics.Tests.ps1 +++ b/Tests/Public/Connect-ZertoAnalytics.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { BeforeAll { @@ -13,8 +13,6 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { } } - - Context "$($global:function)::Function Unit Tests" { InModuleScope -ModuleName ZertoApiWrapper { @@ -68,7 +66,6 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { Assert-MockCalled -ModuleName ZertoApiWrapper -CommandName Invoke-ZARestRequest -Exactly 1 } - } Remove-Variable -Name function -Scope Global diff --git a/Tests/Public/Connect-ZertoServer.Tests.ps1 b/Tests/Public/Connect-ZertoServer.Tests.ps1 index 1cdc5b6..da0ab18 100644 --- a/Tests/Public/Connect-ZertoServer.Tests.ps1 +++ b/Tests/Public/Connect-ZertoServer.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { BeforeAll { @@ -105,11 +105,11 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { $headers = Connect-ZertoServer -zertoServer $Server -credential $credential -returnHeaders It "returns a Hashtable with 2 keys" { $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'" { - $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" { @@ -118,11 +118,11 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { } 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'" { - $headers['accept'] | Should be 'application/json' + $headers['accept'] | Should -Be 'application/json' } It "should not require a port to be specified" { diff --git a/Tests/Public/Copy-ZertoVpg.Tests.ps1 b/Tests/Public/Copy-ZertoVpg.Tests.ps1 index 4bb19e4..6f0c629 100644 --- a/Tests/Public/Copy-ZertoVpg.Tests.ps1 +++ b/Tests/Public/Copy-ZertoVpg.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { BeforeAll { diff --git a/Tests/Public/Disconnect-ZertoServer.Tests.ps1 b/Tests/Public/Disconnect-ZertoServer.Tests.ps1 index 873fab2..51e5f2c 100644 --- a/Tests/Public/Disconnect-ZertoServer.Tests.ps1 +++ b/Tests/Public/Disconnect-ZertoServer.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Edit-ZertoVra.Tests.ps1 b/Tests/Public/Edit-ZertoVra.Tests.ps1 index 9c872fc..3767301 100644 --- a/Tests/Public/Edit-ZertoVra.Tests.ps1 +++ b/Tests/Public/Edit-ZertoVra.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] 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 = 'defaultGateway'; Type = 'String'; Mandatory = $false } @{ParameterName = 'subnetMask'; Type = 'String'; Mandatory = $false } - @{ParameterName = 'HostRootPassword'; Type = 'securestring'; Mandatory = $false} + @{ParameterName = 'HostRootPassword'; Type = 'securestring'; Mandatory = $false } ) It " parameter is of type" -TestCases $ParameterTestCases { @@ -41,7 +41,7 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { @{ ParameterName = 'groupName' } ) - it " validates against null or empty values" -TestCases $StringTestCases { + It " validates against null or empty values" -TestCases $StringTestCases { param($ParameterName) $attrs = (Get-Command $global:function).Parameters[$ParameterName].Attributes $attrs.Where{ $_ -is [ValidateNotNullOrEmpty] }.Count | Should -Be 1 @@ -53,7 +53,7 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { @{ParameterName = 'subnetMask' } ) - it " validates string for a valid IP Address" -TestCases $IpAddrTestCases { + It " validates string for a valid IP Address" -TestCases $IpAddrTestCases { param($ParameterName) $attrs = (Get-Command $global:function).Parameters[$ParameterName].Attributes $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" { $results = Edit-ZertoVra -vraIdentifier "MyVraIdentifier" -groupName "MyGroup" - $results | should not benullorempty - $results | should -BeOfType "String" + $results | Should not benullorempty + $results | Should -BeOfType "String" $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" } - it "Supports 'SupportsShouldProcess'" { + It "Supports 'SupportsShouldProcess'" { Get-Command $global:function | Should -HaveParameter WhatIf Get-Command $global:function | Should -HaveParameter Confirm (Get-Command $global:function).ScriptBlock | Should -Match 'SupportsShouldProcess' diff --git a/Tests/Public/Export-ZertoVmNicSetting.Tests.ps1 b/Tests/Public/Export-ZertoVmNicSetting.Tests.ps1 index be52ffb..f7ecbb1 100644 --- a/Tests/Public/Export-ZertoVmNicSetting.Tests.ps1 +++ b/Tests/Public/Export-ZertoVmNicSetting.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] 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 } - it " has validation set" -TestCases $ParameterTestCases { + It " has validation set" -TestCases $ParameterTestCases { param($ParameterName) $attrs = (Get-Command $global:function).Parameters[$ParameterName].Attributes $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" { - + } } diff --git a/Tests/Public/Export-ZertoVpg.Tests.ps1 b/Tests/Public/Export-ZertoVpg.Tests.ps1 index e733e93..957092a 100644 --- a/Tests/Public/Export-ZertoVpg.Tests.ps1 +++ b/Tests/Public/Export-ZertoVpg.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { @@ -199,11 +199,11 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { $outputPath = "TestDrive:" - it "Output path should exist" { + It "Output path 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" Export-ZertoVpg -outputPath $outputPath -vpgName $vpgName $outputFile = "{0}\{1}.json" -f $outputPath, $vpgName @@ -211,11 +211,11 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { $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 } - it "Should be valid JSON" { + It "Should be valid JSON" { $vpgName = "HRIS" Export-ZertoVpg -outputPath $outputPath -vpgName $vpgName $outputFile = "{0}\{1}.json" -f $outputPath, $vpgName diff --git a/Tests/Public/Get-ZAAlert.Tests.ps1 b/Tests/Public/Get-ZAAlert.Tests.ps1 index 9695510..1a4cd6d 100644 --- a/Tests/Public/Get-ZAAlert.Tests.ps1 +++ b/Tests/Public/Get-ZAAlert.Tests.ps1 @@ -1,13 +1,13 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { Context "$global:function::Parameter Unit Tests" { - it "$global:function should have exactly 14 parameters defined" { - (get-command $global:function).Parameters.Count | Should -Be 14 + It "$global:function should have exactly 14 parameters defined" { + (Get-Command $global:function).Parameters.Count | Should -Be 14 } $ParameterTestCases = @( @@ -35,17 +35,17 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { } 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" { - (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" { - (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 } } diff --git a/Tests/Public/Get-ZADatastore.Tests.ps1 b/Tests/Public/Get-ZADatastore.Tests.ps1 index c148811..8cc0132 100644 --- a/Tests/Public/Get-ZADatastore.Tests.ps1 +++ b/Tests/Public/Get-ZADatastore.Tests.ps1 @@ -1,12 +1,12 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { Context "$global:function::Parameter Unit Tests" { - it "$global:function should have exactly 14 parameters defined" { - (get-command $global:function).Parameters.Count | Should -Be 14 + It "$global:function should have exactly 14 parameters defined" { + (Get-Command $global:function).Parameters.Count | Should -Be 14 } $ParameterTestCases = @( @@ -29,7 +29,7 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { } default { - $true | should be $false -Because "No Validation Selected. Review test cases" + $true | Should -Be $false -Because "No Validation Selected. Review test cases" } } } diff --git a/Tests/Public/Get-ZAEvent.Tests.ps1 b/Tests/Public/Get-ZAEvent.Tests.ps1 index e1e40f6..61bcfd8 100644 --- a/Tests/Public/Get-ZAEvent.Tests.ps1 +++ b/Tests/Public/Get-ZAEvent.Tests.ps1 @@ -1,13 +1,13 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { Context "$global:function::Parameter Unit Tests" { - it "$global:function should have exactly 16 parameters defined" { - (get-command $global:function).Parameters.Count | Should -Be 16 + It "$global:function should have exactly 16 parameters defined" { + (Get-Command $global:function).Parameters.Count | Should -Be 16 } $ParameterTestCases = @( @@ -42,21 +42,21 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { } 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" { - (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" { - (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" { - (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'" { diff --git a/Tests/Public/Get-ZAJournalAverageHistory.Tests.ps1 b/Tests/Public/Get-ZAJournalAverageHistory.Tests.ps1 index 80bf748..4ab1f59 100644 --- a/Tests/Public/Get-ZAJournalAverageHistory.Tests.ps1 +++ b/Tests/Public/Get-ZAJournalAverageHistory.Tests.ps1 @@ -1,13 +1,13 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { Context "$global:function::Parameter Unit Tests" { - it "$global:function should have exactly 15 parameters defined" { - (get-command $global:function).Parameters.Count | Should -Be 15 + It "$global:function should have exactly 15 parameters defined" { + (Get-Command $global:function).Parameters.Count | Should -Be 15 } $ParameterTestCases = @( @@ -36,17 +36,17 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { } 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" { - (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" { - (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 } } diff --git a/Tests/Public/Get-ZAJournalAverageSize.Tests.ps1 b/Tests/Public/Get-ZAJournalAverageSize.Tests.ps1 index f013489..4ab0358 100644 --- a/Tests/Public/Get-ZAJournalAverageSize.Tests.ps1 +++ b/Tests/Public/Get-ZAJournalAverageSize.Tests.ps1 @@ -1,12 +1,12 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { Context "$global:function::Parameter Unit Tests" { - it "$global:function should have exactly 15 parameters defined" { - (get-command $global:function).Parameters.Count | Should -Be 15 + It "$global:function should have exactly 15 parameters defined" { + (Get-Command $global:function).Parameters.Count | Should -Be 15 } $ParameterTestCases = @( @@ -35,17 +35,17 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { } 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" { - (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" { - (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 } } diff --git a/Tests/Public/Get-ZAJournalBreach.Tests.ps1 b/Tests/Public/Get-ZAJournalBreach.Tests.ps1 index b0761f1..94b7a9e 100644 --- a/Tests/Public/Get-ZAJournalBreach.Tests.ps1 +++ b/Tests/Public/Get-ZAJournalBreach.Tests.ps1 @@ -1,12 +1,12 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { Context "$global:function::Parameter Unit Tests" { - it "$global:function should have exactly 14 parameters defined" { - (get-command $global:function).Parameters.Count | Should -Be 14 + It "$global:function should have exactly 14 parameters defined" { + (Get-Command $global:function).Parameters.Count | Should -Be 14 } $ParameterTestCases = @( @@ -29,7 +29,7 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { } default { - $true | should be $false -Because "No Validation Selected. Review test cases" + $true | Should -Be $false -Because "No Validation Selected. Review test cases" } } } diff --git a/Tests/Public/Get-ZAJournalHistoryStat.Tests.ps1 b/Tests/Public/Get-ZAJournalHistoryStat.Tests.ps1 index b0761f1..94b7a9e 100644 --- a/Tests/Public/Get-ZAJournalHistoryStat.Tests.ps1 +++ b/Tests/Public/Get-ZAJournalHistoryStat.Tests.ps1 @@ -1,12 +1,12 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { Context "$global:function::Parameter Unit Tests" { - it "$global:function should have exactly 14 parameters defined" { - (get-command $global:function).Parameters.Count | Should -Be 14 + It "$global:function should have exactly 14 parameters defined" { + (Get-Command $global:function).Parameters.Count | Should -Be 14 } $ParameterTestCases = @( @@ -29,7 +29,7 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { } default { - $true | should be $false -Because "No Validation Selected. Review test cases" + $true | Should -Be $false -Because "No Validation Selected. Review test cases" } } } diff --git a/Tests/Public/Get-ZAJournalSiteAverageHistory.Tests.ps1 b/Tests/Public/Get-ZAJournalSiteAverageHistory.Tests.ps1 index 6583c27..b91ec04 100644 --- a/Tests/Public/Get-ZAJournalSiteAverageHistory.Tests.ps1 +++ b/Tests/Public/Get-ZAJournalSiteAverageHistory.Tests.ps1 @@ -1,12 +1,12 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { Context "$global:function::Parameter Unit Tests" { - it "$global:function should have exactly 15 parameters defined" { - (get-command $global:function).Parameters.Count | Should -Be 15 + It "$global:function should have exactly 15 parameters defined" { + (Get-Command $global:function).Parameters.Count | Should -Be 15 } $ParameterTestCases = @( @@ -35,17 +35,17 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { } 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" { - (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" { - (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 } } diff --git a/Tests/Public/Get-ZAJournalSiteAverageSize.Tests.ps1 b/Tests/Public/Get-ZAJournalSiteAverageSize.Tests.ps1 index 6583c27..b91ec04 100644 --- a/Tests/Public/Get-ZAJournalSiteAverageSize.Tests.ps1 +++ b/Tests/Public/Get-ZAJournalSiteAverageSize.Tests.ps1 @@ -1,12 +1,12 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { Context "$global:function::Parameter Unit Tests" { - it "$global:function should have exactly 15 parameters defined" { - (get-command $global:function).Parameters.Count | Should -Be 15 + It "$global:function should have exactly 15 parameters defined" { + (Get-Command $global:function).Parameters.Count | Should -Be 15 } $ParameterTestCases = @( @@ -35,17 +35,17 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { } 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" { - (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" { - (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 } } diff --git a/Tests/Public/Get-ZAJournalSiteHistoryStat.Tests.ps1 b/Tests/Public/Get-ZAJournalSiteHistoryStat.Tests.ps1 index 6583c27..b91ec04 100644 --- a/Tests/Public/Get-ZAJournalSiteHistoryStat.Tests.ps1 +++ b/Tests/Public/Get-ZAJournalSiteHistoryStat.Tests.ps1 @@ -1,12 +1,12 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { Context "$global:function::Parameter Unit Tests" { - it "$global:function should have exactly 15 parameters defined" { - (get-command $global:function).Parameters.Count | Should -Be 15 + It "$global:function should have exactly 15 parameters defined" { + (Get-Command $global:function).Parameters.Count | Should -Be 15 } $ParameterTestCases = @( @@ -35,17 +35,17 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { } 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" { - (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" { - (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 } } diff --git a/Tests/Public/Get-ZAJournalSiteHistorySummary.Tests.ps1 b/Tests/Public/Get-ZAJournalSiteHistorySummary.Tests.ps1 index 6583c27..b91ec04 100644 --- a/Tests/Public/Get-ZAJournalSiteHistorySummary.Tests.ps1 +++ b/Tests/Public/Get-ZAJournalSiteHistorySummary.Tests.ps1 @@ -1,12 +1,12 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { Context "$global:function::Parameter Unit Tests" { - it "$global:function should have exactly 15 parameters defined" { - (get-command $global:function).Parameters.Count | Should -Be 15 + It "$global:function should have exactly 15 parameters defined" { + (Get-Command $global:function).Parameters.Count | Should -Be 15 } $ParameterTestCases = @( @@ -35,17 +35,17 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { } 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" { - (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" { - (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 } } diff --git a/Tests/Public/Get-ZAJournalSiteSizeStat.Tests.ps1 b/Tests/Public/Get-ZAJournalSiteSizeStat.Tests.ps1 index 6583c27..b91ec04 100644 --- a/Tests/Public/Get-ZAJournalSiteSizeStat.Tests.ps1 +++ b/Tests/Public/Get-ZAJournalSiteSizeStat.Tests.ps1 @@ -1,12 +1,12 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { Context "$global:function::Parameter Unit Tests" { - it "$global:function should have exactly 15 parameters defined" { - (get-command $global:function).Parameters.Count | Should -Be 15 + It "$global:function should have exactly 15 parameters defined" { + (Get-Command $global:function).Parameters.Count | Should -Be 15 } $ParameterTestCases = @( @@ -35,17 +35,17 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { } 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" { - (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" { - (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 } } diff --git a/Tests/Public/Get-ZAJournalStatusProportion.Tests.ps1 b/Tests/Public/Get-ZAJournalStatusProportion.Tests.ps1 index b0761f1..94b7a9e 100644 --- a/Tests/Public/Get-ZAJournalStatusProportion.Tests.ps1 +++ b/Tests/Public/Get-ZAJournalStatusProportion.Tests.ps1 @@ -1,12 +1,12 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { Context "$global:function::Parameter Unit Tests" { - it "$global:function should have exactly 14 parameters defined" { - (get-command $global:function).Parameters.Count | Should -Be 14 + It "$global:function should have exactly 14 parameters defined" { + (Get-Command $global:function).Parameters.Count | Should -Be 14 } $ParameterTestCases = @( @@ -29,7 +29,7 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { } default { - $true | should be $false -Because "No Validation Selected. Review test cases" + $true | Should -Be $false -Because "No Validation Selected. Review test cases" } } } diff --git a/Tests/Public/Get-ZAJournalStorageStat.Tests.ps1 b/Tests/Public/Get-ZAJournalStorageStat.Tests.ps1 index b0761f1..94b7a9e 100644 --- a/Tests/Public/Get-ZAJournalStorageStat.Tests.ps1 +++ b/Tests/Public/Get-ZAJournalStorageStat.Tests.ps1 @@ -1,12 +1,12 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { Context "$global:function::Parameter Unit Tests" { - it "$global:function should have exactly 14 parameters defined" { - (get-command $global:function).Parameters.Count | Should -Be 14 + It "$global:function should have exactly 14 parameters defined" { + (Get-Command $global:function).Parameters.Count | Should -Be 14 } $ParameterTestCases = @( @@ -29,7 +29,7 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { } default { - $true | should be $false -Because "No Validation Selected. Review test cases" + $true | Should -Be $false -Because "No Validation Selected. Review test cases" } } } diff --git a/Tests/Public/Get-ZAJournalSummary.Tests.ps1 b/Tests/Public/Get-ZAJournalSummary.Tests.ps1 index b0761f1..94b7a9e 100644 --- a/Tests/Public/Get-ZAJournalSummary.Tests.ps1 +++ b/Tests/Public/Get-ZAJournalSummary.Tests.ps1 @@ -1,12 +1,12 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { Context "$global:function::Parameter Unit Tests" { - it "$global:function should have exactly 14 parameters defined" { - (get-command $global:function).Parameters.Count | Should -Be 14 + It "$global:function should have exactly 14 parameters defined" { + (Get-Command $global:function).Parameters.Count | Should -Be 14 } $ParameterTestCases = @( @@ -29,7 +29,7 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { } default { - $true | should be $false -Because "No Validation Selected. Review test cases" + $true | Should -Be $false -Because "No Validation Selected. Review test cases" } } } diff --git a/Tests/Public/Get-ZALicense.Tests.ps1 b/Tests/Public/Get-ZALicense.Tests.ps1 index c7e8462..e3e16ee 100644 --- a/Tests/Public/Get-ZALicense.Tests.ps1 +++ b/Tests/Public/Get-ZALicense.Tests.ps1 @@ -1,12 +1,12 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { Context "$global:function::Parameter Unit Tests" { - it "$global:function should have exactly 11 parameters defined" { - (get-command $global:function).Parameters.Count | Should -Be 11 + It "$global:function should have exactly 11 parameters defined" { + (Get-Command $global:function).Parameters.Count | Should -Be 11 } } diff --git a/Tests/Public/Get-ZAMonitoring.Tests.ps1 b/Tests/Public/Get-ZAMonitoring.Tests.ps1 index 69c36ca..1ced87b 100644 --- a/Tests/Public/Get-ZAMonitoring.Tests.ps1 +++ b/Tests/Public/Get-ZAMonitoring.Tests.ps1 @@ -1,15 +1,15 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { Context "$global:function::Parameter Unit Tests" { - it "$global:function should have exactly 12 parameters defined" { - (get-command $global:function).Parameters.Count | Should -Be 12 + It "$global:function should have exactly 12 parameters defined" { + (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 -not -Mandatory } diff --git a/Tests/Public/Get-ZANetworkSiteAverageIOPS.Tests.ps1 b/Tests/Public/Get-ZANetworkSiteAverageIOPS.Tests.ps1 index df1588a..be1237c 100644 --- a/Tests/Public/Get-ZANetworkSiteAverageIOPS.Tests.ps1 +++ b/Tests/Public/Get-ZANetworkSiteAverageIOPS.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { @@ -37,17 +37,17 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { } 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" { - (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" { - (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 } } diff --git a/Tests/Public/Get-ZANetworkSiteAveragePerformance.Tests.ps1 b/Tests/Public/Get-ZANetworkSiteAveragePerformance.Tests.ps1 index df1588a..be1237c 100644 --- a/Tests/Public/Get-ZANetworkSiteAveragePerformance.Tests.ps1 +++ b/Tests/Public/Get-ZANetworkSiteAveragePerformance.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { @@ -37,17 +37,17 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { } 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" { - (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" { - (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 } } diff --git a/Tests/Public/Get-ZANetworkSiteStat.Tests.ps1 b/Tests/Public/Get-ZANetworkSiteStat.Tests.ps1 index 80f948f..0d7b26a 100644 --- a/Tests/Public/Get-ZANetworkSiteStat.Tests.ps1 +++ b/Tests/Public/Get-ZANetworkSiteStat.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { @@ -36,7 +36,7 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { } default { - $true | Should be $false -Because "No Validation Selected. Review test cases" + $true | Should -Be $false -Because "No Validation Selected. Review test cases" } } } diff --git a/Tests/Public/Get-ZANetworkSiteSummary.Tests.ps1 b/Tests/Public/Get-ZANetworkSiteSummary.Tests.ps1 index 80f948f..0d7b26a 100644 --- a/Tests/Public/Get-ZANetworkSiteSummary.Tests.ps1 +++ b/Tests/Public/Get-ZANetworkSiteSummary.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { @@ -36,7 +36,7 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { } default { - $true | Should be $false -Because "No Validation Selected. Review test cases" + $true | Should -Be $false -Because "No Validation Selected. Review test cases" } } } diff --git a/Tests/Public/Get-ZANetworkVpgAverageIOPS.Tests.ps1 b/Tests/Public/Get-ZANetworkVpgAverageIOPS.Tests.ps1 index 191f7a9..4ab0358 100644 --- a/Tests/Public/Get-ZANetworkVpgAverageIOPS.Tests.ps1 +++ b/Tests/Public/Get-ZANetworkVpgAverageIOPS.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { @@ -35,17 +35,17 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { } 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" { - (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" { - (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 } } diff --git a/Tests/Public/Get-ZANetworkVpgAveragePerformance.Tests.ps1 b/Tests/Public/Get-ZANetworkVpgAveragePerformance.Tests.ps1 index 191f7a9..4ab0358 100644 --- a/Tests/Public/Get-ZANetworkVpgAveragePerformance.Tests.ps1 +++ b/Tests/Public/Get-ZANetworkVpgAveragePerformance.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { @@ -35,17 +35,17 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { } 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" { - (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" { - (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 } } diff --git a/Tests/Public/Get-ZANetworkVpgStat.Tests.ps1 b/Tests/Public/Get-ZANetworkVpgStat.Tests.ps1 index e9026db..e2ece1b 100644 --- a/Tests/Public/Get-ZANetworkVpgStat.Tests.ps1 +++ b/Tests/Public/Get-ZANetworkVpgStat.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { @@ -34,7 +34,7 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { } default { - $true | Should be $false -Because "No Validation Selected. Review test cases" + $true | Should -Be $false -Because "No Validation Selected. Review test cases" } } } diff --git a/Tests/Public/Get-ZANetworkVpgSummary.Tests.ps1 b/Tests/Public/Get-ZANetworkVpgSummary.Tests.ps1 index e9026db..e2ece1b 100644 --- a/Tests/Public/Get-ZANetworkVpgSummary.Tests.ps1 +++ b/Tests/Public/Get-ZANetworkVpgSummary.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { @@ -34,7 +34,7 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { } default { - $true | Should be $false -Because "No Validation Selected. Review test cases" + $true | Should -Be $false -Because "No Validation Selected. Review test cases" } } } diff --git a/Tests/Public/Get-ZAPlannerJournalSizeReport.Tests.ps1 b/Tests/Public/Get-ZAPlannerJournalSizeReport.Tests.ps1 index bed9818..f6b7536 100644 --- a/Tests/Public/Get-ZAPlannerJournalSizeReport.Tests.ps1 +++ b/Tests/Public/Get-ZAPlannerJournalSizeReport.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { @@ -42,7 +42,7 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { } default { - $true | Should be $false -Because "No Validation Selected. Review test cases" + $true | Should -Be $false -Because "No Validation Selected. Review test cases" } } } diff --git a/Tests/Public/Get-ZAPlannerNetworkPerformanceReport.Tests.ps1 b/Tests/Public/Get-ZAPlannerNetworkPerformanceReport.Tests.ps1 index 5e2b7f6..357d797 100644 --- a/Tests/Public/Get-ZAPlannerNetworkPerformanceReport.Tests.ps1 +++ b/Tests/Public/Get-ZAPlannerNetworkPerformanceReport.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { @@ -42,7 +42,7 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { } default { - $true | Should be $false -Because "No Validation Selected. Review test cases" + $true | Should -Be $false -Because "No Validation Selected. Review test cases" } } } diff --git a/Tests/Public/Get-ZAPlannerSite.Tests.ps1 b/Tests/Public/Get-ZAPlannerSite.Tests.ps1 index ef63e5c..0697f3d 100644 --- a/Tests/Public/Get-ZAPlannerSite.Tests.ps1 +++ b/Tests/Public/Get-ZAPlannerSite.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { @@ -27,7 +27,7 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { } default { - $true | Should be $false -Because "No Validation Selected. Review test cases" + $true | Should -Be $false -Because "No Validation Selected. Review test cases" } } } diff --git a/Tests/Public/Get-ZAPlannerStatsReport.Tests.ps1 b/Tests/Public/Get-ZAPlannerStatsReport.Tests.ps1 index bed9818..f6b7536 100644 --- a/Tests/Public/Get-ZAPlannerStatsReport.Tests.ps1 +++ b/Tests/Public/Get-ZAPlannerStatsReport.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { @@ -42,7 +42,7 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { } default { - $true | Should be $false -Because "No Validation Selected. Review test cases" + $true | Should -Be $false -Because "No Validation Selected. Review test cases" } } } diff --git a/Tests/Public/Get-ZAPlannerWanReport.Tests.ps1 b/Tests/Public/Get-ZAPlannerWanReport.Tests.ps1 index 238ba22..6f43e52 100644 --- a/Tests/Public/Get-ZAPlannerWanReport.Tests.ps1 +++ b/Tests/Public/Get-ZAPlannerWanReport.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { @@ -41,7 +41,7 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { } default { - $true | Should be $false -Because "No Validation Selected. Review test cases" + $true | Should -Be $false -Because "No Validation Selected. Review test cases" } } } diff --git a/Tests/Public/Get-ZAPlannerZcasReport.Tests.ps1 b/Tests/Public/Get-ZAPlannerZcasReport.Tests.ps1 index 0412e64..9940422 100644 --- a/Tests/Public/Get-ZAPlannerZcasReport.Tests.ps1 +++ b/Tests/Public/Get-ZAPlannerZcasReport.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { @@ -41,7 +41,7 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { } default { - $true | Should be $false -Because "No Validation Selected. Review test cases" + $true | Should -Be $false -Because "No Validation Selected. Review test cases" } } } diff --git a/Tests/Public/Get-ZAProtectedVm.Tests.ps1 b/Tests/Public/Get-ZAProtectedVm.Tests.ps1 index 89e1e5d..cb28168 100644 --- a/Tests/Public/Get-ZAProtectedVm.Tests.ps1 +++ b/Tests/Public/Get-ZAProtectedVm.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Get-ZAProtectedVmReport.Tests.ps1 b/Tests/Public/Get-ZAProtectedVmReport.Tests.ps1 index 95ad321..40af444 100644 --- a/Tests/Public/Get-ZAProtectedVmReport.Tests.ps1 +++ b/Tests/Public/Get-ZAProtectedVmReport.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Get-ZARPOAccountAverage.Tests.ps1 b/Tests/Public/Get-ZARPOAccountAverage.Tests.ps1 index 18f58ae..5ba5c2d 100644 --- a/Tests/Public/Get-ZARPOAccountAverage.Tests.ps1 +++ b/Tests/Public/Get-ZARPOAccountAverage.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { @@ -29,7 +29,7 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { } default { - $true | Should be $false -Because "No Validation Selected. Review test cases" + $true | Should -Be $false -Because "No Validation Selected. Review test cases" } } } diff --git a/Tests/Public/Get-ZARPOAverage.Tests.ps1 b/Tests/Public/Get-ZARPOAverage.Tests.ps1 index 8619700..eb3a548 100644 --- a/Tests/Public/Get-ZARPOAverage.Tests.ps1 +++ b/Tests/Public/Get-ZARPOAverage.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { @@ -35,17 +35,17 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { } 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" { - (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" { - (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 } } diff --git a/Tests/Public/Get-ZARPOBreach.Tests.ps1 b/Tests/Public/Get-ZARPOBreach.Tests.ps1 index 38456f9..94b7a9e 100644 --- a/Tests/Public/Get-ZARPOBreach.Tests.ps1 +++ b/Tests/Public/Get-ZARPOBreach.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { @@ -29,7 +29,7 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { } default { - $true | Should be $false -Because "No Validation Selected. Review test cases" + $true | Should -Be $false -Because "No Validation Selected. Review test cases" } } } diff --git a/Tests/Public/Get-ZARPOStat.Tests.ps1 b/Tests/Public/Get-ZARPOStat.Tests.ps1 index 38456f9..94b7a9e 100644 --- a/Tests/Public/Get-ZARPOStat.Tests.ps1 +++ b/Tests/Public/Get-ZARPOStat.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { @@ -29,7 +29,7 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { } default { - $true | Should be $false -Because "No Validation Selected. Review test cases" + $true | Should -Be $false -Because "No Validation Selected. Review test cases" } } } diff --git a/Tests/Public/Get-ZARPOStatusProportion.Tests.ps1 b/Tests/Public/Get-ZARPOStatusProportion.Tests.ps1 index 38456f9..94b7a9e 100644 --- a/Tests/Public/Get-ZARPOStatusProportion.Tests.ps1 +++ b/Tests/Public/Get-ZARPOStatusProportion.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { @@ -29,7 +29,7 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { } default { - $true | Should be $false -Because "No Validation Selected. Review test cases" + $true | Should -Be $false -Because "No Validation Selected. Review test cases" } } } diff --git a/Tests/Public/Get-ZARPOSummary.Tests.ps1 b/Tests/Public/Get-ZARPOSummary.Tests.ps1 index 38456f9..94b7a9e 100644 --- a/Tests/Public/Get-ZARPOSummary.Tests.ps1 +++ b/Tests/Public/Get-ZARPOSummary.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { @@ -29,7 +29,7 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { } default { - $true | Should be $false -Because "No Validation Selected. Review test cases" + $true | Should -Be $false -Because "No Validation Selected. Review test cases" } } } diff --git a/Tests/Public/Get-ZASite.Tests.ps1 b/Tests/Public/Get-ZASite.Tests.ps1 index fd61b07..6ce1ca9 100644 --- a/Tests/Public/Get-ZASite.Tests.ps1 +++ b/Tests/Public/Get-ZASite.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { @@ -14,7 +14,7 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { } 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 } } diff --git a/Tests/Public/Get-ZASitePair.Tests.ps1 b/Tests/Public/Get-ZASitePair.Tests.ps1 index 18f58ae..5ba5c2d 100644 --- a/Tests/Public/Get-ZASitePair.Tests.ps1 +++ b/Tests/Public/Get-ZASitePair.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { @@ -29,7 +29,7 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { } default { - $true | Should be $false -Because "No Validation Selected. Review test cases" + $true | Should -Be $false -Because "No Validation Selected. Review test cases" } } } diff --git a/Tests/Public/Get-ZASiteTopology.Tests.ps1 b/Tests/Public/Get-ZASiteTopology.Tests.ps1 index f1136ba..ebe6cb0 100644 --- a/Tests/Public/Get-ZASiteTopology.Tests.ps1 +++ b/Tests/Public/Get-ZASiteTopology.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { @@ -27,7 +27,7 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { } default { - $true | Should be $false -Because "No Validation Selected. Review test cases" + $true | Should -Be $false -Because "No Validation Selected. Review test cases" } } } diff --git a/Tests/Public/Get-ZATask.Tests.ps1 b/Tests/Public/Get-ZATask.Tests.ps1 index 7e712d4..2a38bde 100644 --- a/Tests/Public/Get-ZATask.Tests.ps1 +++ b/Tests/Public/Get-ZATask.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { @@ -34,17 +34,17 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { } 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" { - (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" { - (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 } } diff --git a/Tests/Public/Get-ZAVolume.Tests.ps1 b/Tests/Public/Get-ZAVolume.Tests.ps1 index c4b6a8c..7042d03 100644 --- a/Tests/Public/Get-ZAVolume.Tests.ps1 +++ b/Tests/Public/Get-ZAVolume.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { @@ -30,7 +30,7 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { } default { - $true | Should be $false -Because "No Validation Selected. Review test cases" + $true | Should -Be $false -Because "No Validation Selected. Review test cases" } } } diff --git a/Tests/Public/Get-ZAVpg.Tests.ps1 b/Tests/Public/Get-ZAVpg.Tests.ps1 index ae44aa0..90f9b3f 100644 --- a/Tests/Public/Get-ZAVpg.Tests.ps1 +++ b/Tests/Public/Get-ZAVpg.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { @@ -28,7 +28,7 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { } default { - $true | Should be $false -Because "No Validation Selected. Review test cases" + $true | Should -Be $false -Because "No Validation Selected. Review test cases" } } } diff --git a/Tests/Public/Get-ZAzOrg.Tests.ps1 b/Tests/Public/Get-ZAzOrg.Tests.ps1 index 8ac00f2..e3e16ee 100644 --- a/Tests/Public/Get-ZAzOrg.Tests.ps1 +++ b/Tests/Public/Get-ZAzOrg.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Get-ZertoAlert.Tests.ps1 b/Tests/Public/Get-ZertoAlert.Tests.ps1 index 8f3c29b..9944cda 100644 --- a/Tests/Public/Get-ZertoAlert.Tests.ps1 +++ b/Tests/Public/Get-ZertoAlert.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Get-ZertoDatastore.Tests.ps1 b/Tests/Public/Get-ZertoDatastore.Tests.ps1 index 5deb346..a250084 100644 --- a/Tests/Public/Get-ZertoDatastore.Tests.ps1 +++ b/Tests/Public/Get-ZertoDatastore.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] 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" { - (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 } } diff --git a/Tests/Public/Get-ZertoEvent.Tests.ps1 b/Tests/Public/Get-ZertoEvent.Tests.ps1 index b257e26..5a418e8 100644 --- a/Tests/Public/Get-ZertoEvent.Tests.ps1 +++ b/Tests/Public/Get-ZertoEvent.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { @@ -53,13 +53,13 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { } 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" { - (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" { @@ -79,7 +79,7 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { } 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" { @@ -95,7 +95,7 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { } 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" { diff --git a/Tests/Public/Get-ZertoLicense.Tests.ps1 b/Tests/Public/Get-ZertoLicense.Tests.ps1 index 8ac00f2..e3e16ee 100644 --- a/Tests/Public/Get-ZertoLicense.Tests.ps1 +++ b/Tests/Public/Get-ZertoLicense.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Get-ZertoLocalSite.Tests.ps1 b/Tests/Public/Get-ZertoLocalSite.Tests.ps1 index fe3af42..b82e8a6 100644 --- a/Tests/Public/Get-ZertoLocalSite.Tests.ps1 +++ b/Tests/Public/Get-ZertoLocalSite.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Get-ZertoPeerSite.Tests.ps1 b/Tests/Public/Get-ZertoPeerSite.Tests.ps1 index 2583c97..16ab624 100644 --- a/Tests/Public/Get-ZertoPeerSite.Tests.ps1 +++ b/Tests/Public/Get-ZertoPeerSite.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { @@ -38,7 +38,7 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { } default { - $true | Should be $false -Because "No Validation Selected. Review test cases" + $true | Should -Be $false -Because "No Validation Selected. Review test cases" } } } diff --git a/Tests/Public/Get-ZertoProtectedVm.Tests.ps1 b/Tests/Public/Get-ZertoProtectedVm.Tests.ps1 index e6e6083..770482b 100644 --- a/Tests/Public/Get-ZertoProtectedVm.Tests.ps1 +++ b/Tests/Public/Get-ZertoProtectedVm.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Get-ZertoRecoveryReport.Tests.ps1 b/Tests/Public/Get-ZertoRecoveryReport.Tests.ps1 index e6e6083..770482b 100644 --- a/Tests/Public/Get-ZertoRecoveryReport.Tests.ps1 +++ b/Tests/Public/Get-ZertoRecoveryReport.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Get-ZertoResourcesReport.Tests.ps1 b/Tests/Public/Get-ZertoResourcesReport.Tests.ps1 index e6e6083..770482b 100644 --- a/Tests/Public/Get-ZertoResourcesReport.Tests.ps1 +++ b/Tests/Public/Get-ZertoResourcesReport.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Get-ZertoServiceProfile.Tests.ps1 b/Tests/Public/Get-ZertoServiceProfile.Tests.ps1 index e6e6083..770482b 100644 --- a/Tests/Public/Get-ZertoServiceProfile.Tests.ps1 +++ b/Tests/Public/Get-ZertoServiceProfile.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Get-ZertoTask.Tests.ps1 b/Tests/Public/Get-ZertoTask.Tests.ps1 index e6e6083..770482b 100644 --- a/Tests/Public/Get-ZertoTask.Tests.ps1 +++ b/Tests/Public/Get-ZertoTask.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Get-ZertoUnprotectedVm.Tests.ps1 b/Tests/Public/Get-ZertoUnprotectedVm.Tests.ps1 index e6e6083..770482b 100644 --- a/Tests/Public/Get-ZertoUnprotectedVm.Tests.ps1 +++ b/Tests/Public/Get-ZertoUnprotectedVm.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Get-ZertoVirtualizationSite.Tests.ps1 b/Tests/Public/Get-ZertoVirtualizationSite.Tests.ps1 index b5f0f7e..100a482 100644 --- a/Tests/Public/Get-ZertoVirtualizationSite.Tests.ps1 +++ b/Tests/Public/Get-ZertoVirtualizationSite.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { BeforeAll { @@ -59,7 +59,7 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { } Context "$global:function::Parameter Functional Tests" { - Mock -ModuleName ZertoApiWrapper -CommandName Invoke-ZertoRestRequest -ParameterFilter { + Mock -ModuleName ZertoApiWrapper -CommandName Invoke-ZertoRestRequest -ParameterFilter { $uri -eq 'virtualizationsites' } { return (Get-Content "$global:here\Mocks\VirtualSite-NoParams.json" -Raw) | ConvertFrom-Json diff --git a/Tests/Public/Get-ZertoVolume.Tests.ps1 b/Tests/Public/Get-ZertoVolume.Tests.ps1 index 4b86f54..a46cda1 100644 --- a/Tests/Public/Get-ZertoVolume.Tests.ps1 +++ b/Tests/Public/Get-ZertoVolume.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Get-ZertoVpg.Tests.ps1 b/Tests/Public/Get-ZertoVpg.Tests.ps1 index e6e6083..770482b 100644 --- a/Tests/Public/Get-ZertoVpg.Tests.ps1 +++ b/Tests/Public/Get-ZertoVpg.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Get-ZertoVpgSetting.Tests.ps1 b/Tests/Public/Get-ZertoVpgSetting.Tests.ps1 index e6e6083..770482b 100644 --- a/Tests/Public/Get-ZertoVpgSetting.Tests.ps1 +++ b/Tests/Public/Get-ZertoVpgSetting.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Get-ZertoVra.Tests.ps1 b/Tests/Public/Get-ZertoVra.Tests.ps1 index e6e6083..770482b 100644 --- a/Tests/Public/Get-ZertoVra.Tests.ps1 +++ b/Tests/Public/Get-ZertoVra.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Get-ZertoZorg.Tests.ps1 b/Tests/Public/Get-ZertoZorg.Tests.ps1 index e6e6083..770482b 100644 --- a/Tests/Public/Get-ZertoZorg.Tests.ps1 +++ b/Tests/Public/Get-ZertoZorg.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Get-ZertoZsspSession.Tests.ps1 b/Tests/Public/Get-ZertoZsspSession.Tests.ps1 index e6e6083..770482b 100644 --- a/Tests/Public/Get-ZertoZsspSession.Tests.ps1 +++ b/Tests/Public/Get-ZertoZsspSession.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Import-ZertoVmNicSetting.Tests.ps1 b/Tests/Public/Import-ZertoVmNicSetting.Tests.ps1 index ce84a86..20db68c 100644 --- a/Tests/Public/Import-ZertoVmNicSetting.Tests.ps1 +++ b/Tests/Public/Import-ZertoVmNicSetting.Tests.ps1 @@ -1,12 +1,12 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { Context "$global:function::Parameter Unit Tests" { - it "$global:function should have exactly 11 parameters defined" { - (get-command $global:function).Parameters.Count | Should -Be 14 + It "$global:function should have exactly 11 parameters defined" { + (Get-Command $global:function).Parameters.Count | Should -Be 14 } It "Has a mandatory string array parameter for the settings file to import" { diff --git a/Tests/Public/Import-ZertoVpg.Tests.ps1 b/Tests/Public/Import-ZertoVpg.Tests.ps1 index f0f8969..6b48c30 100644 --- a/Tests/Public/Import-ZertoVpg.Tests.ps1 +++ b/Tests/Public/Import-ZertoVpg.Tests.ps1 @@ -1,12 +1,12 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { Context "$global:function::Parameter Unit Tests" { - it "$global:function should have exactly 12 parameters defined" { - (get-command $global:function).Parameters.Count | Should -Be 12 + It "$global:function should have exactly 12 parameters defined" { + (Get-Command $global:function).Parameters.Count | Should -Be 12 } It "Has a mandatory string array parameter for the settings file to import" { diff --git a/Tests/Public/Install-ZertoVra.Tests.ps1 b/Tests/Public/Install-ZertoVra.Tests.ps1 index 7105db6..a5005d3 100644 --- a/Tests/Public/Install-ZertoVra.Tests.ps1 +++ b/Tests/Public/Install-ZertoVra.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Invoke-ZARestRequest.Tests.ps1 b/Tests/Public/Invoke-ZARestRequest.Tests.ps1 index c545e56..983c373 100644 --- a/Tests/Public/Invoke-ZARestRequest.Tests.ps1 +++ b/Tests/Public/Invoke-ZARestRequest.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { @@ -63,7 +63,7 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { } 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" { diff --git a/Tests/Public/Invoke-ZertoEvacuateVra.Tests.ps1 b/Tests/Public/Invoke-ZertoEvacuateVra.Tests.ps1 index 47629c7..cfd3c2e 100644 --- a/Tests/Public/Invoke-ZertoEvacuateVra.Tests.ps1 +++ b/Tests/Public/Invoke-ZertoEvacuateVra.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Invoke-ZertoFailover.Tests.ps1 b/Tests/Public/Invoke-ZertoFailover.Tests.ps1 index 11dd2f9..88e38bd 100644 --- a/Tests/Public/Invoke-ZertoFailover.Tests.ps1 +++ b/Tests/Public/Invoke-ZertoFailover.Tests.ps1 @@ -1,12 +1,12 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { Context "$global:function::Parameter Unit Tests" { - it "$global:function should have exactly 20 parameters defined" { - (get-command $global:function).Parameters.Count | Should -Be 20 + It "$global:function should have exactly 20 parameters defined" { + (Get-Command $global:function).Parameters.Count | Should -Be 20 } $ParameterTestCases = @( @@ -55,7 +55,7 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { } 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 } - 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 } - 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] }.MaxRange | Should -Be 86400 } diff --git a/Tests/Public/Invoke-ZertoFailoverCommit.Tests.ps1 b/Tests/Public/Invoke-ZertoFailoverCommit.Tests.ps1 index aec697f..5c59b8b 100644 --- a/Tests/Public/Invoke-ZertoFailoverCommit.Tests.ps1 +++ b/Tests/Public/Invoke-ZertoFailoverCommit.Tests.ps1 @@ -1,13 +1,13 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { Context "$global:function::Parameter Unit Tests" { - it "$global:function should have exactly 15 parameters defined" { - (get-command $global:function).Parameters.Count | Should -Be 15 + It "$global:function should have exactly 15 parameters defined" { + (Get-Command $global:function).Parameters.Count | Should -Be 15 } $ParameterTestCases = @( @@ -41,7 +41,7 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { } default { - $true | should be $false -Because "No Validation Selected. Review test cases" + $true | Should -Be $false -Because "No Validation Selected. Review test cases" } } } diff --git a/Tests/Public/Invoke-ZertoFailoverRollback.Tests.ps1 b/Tests/Public/Invoke-ZertoFailoverRollback.Tests.ps1 index 84109bd..248b8f1 100644 --- a/Tests/Public/Invoke-ZertoFailoverRollback.Tests.ps1 +++ b/Tests/Public/Invoke-ZertoFailoverRollback.Tests.ps1 @@ -1,16 +1,16 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { Context "$global:function::Parameter Unit Tests" { - it "$global:function should have exactly 12 parameters defined" { - (get-command $global:function).Parameters.Count | Should -Be 12 + It "$global:function should have exactly 12 parameters defined" { + (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 -Type string[] Get-Command $global:function | Should -HaveParameter vpgName -Mandatory diff --git a/Tests/Public/Invoke-ZertoForceSync.Tests.ps1 b/Tests/Public/Invoke-ZertoForceSync.Tests.ps1 index 159e825..e35259a 100644 --- a/Tests/Public/Invoke-ZertoForceSync.Tests.ps1 +++ b/Tests/Public/Invoke-ZertoForceSync.Tests.ps1 @@ -1,16 +1,16 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { Context "$global:function::Parameter Unit Tests" { - it "$global:function should have exactly 12 parameters defined" { - (get-command $global:function).Parameters.Count | Should -Be 12 + It "$global:function should have exactly 12 parameters defined" { + (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 -Type string[] Get-Command $global:function | Should -HaveParameter vpgName -Mandatory diff --git a/Tests/Public/Invoke-ZertoMove.Tests.ps1 b/Tests/Public/Invoke-ZertoMove.Tests.ps1 index 6217a52..aaca87b 100644 --- a/Tests/Public/Invoke-ZertoMove.Tests.ps1 +++ b/Tests/Public/Invoke-ZertoMove.Tests.ps1 @@ -1,12 +1,12 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { Context "$global:function::Parameter Unit Tests" { - it "$global:function should have exactly 20 parameters defined" { - (get-command $global:function).Parameters.Count | Should -Be 20 + It "$global:function should have exactly 20 parameters defined" { + (Get-Command $global:function).Parameters.Count | Should -Be 20 } $ParameterTestCases = @( @@ -55,7 +55,7 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { } 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' } - 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] }.MaxRange | Should -Be 86400 } diff --git a/Tests/Public/Invoke-ZertoMoveCommit.Tests.ps1 b/Tests/Public/Invoke-ZertoMoveCommit.Tests.ps1 index b8abfd8..06b7449 100644 --- a/Tests/Public/Invoke-ZertoMoveCommit.Tests.ps1 +++ b/Tests/Public/Invoke-ZertoMoveCommit.Tests.ps1 @@ -1,13 +1,13 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { Context "$global:function::Parameter Unit Tests" { - it "$global:function should have exactly 16 parameters defined" { - (get-command $global:function).Parameters.Count | Should -Be 16 + It "$global:function should have exactly 16 parameters defined" { + (Get-Command $global:function).Parameters.Count | Should -Be 16 } $ParameterTestCases = @( @@ -41,7 +41,7 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { } default { - $true | should be $false -Because "No Validation Selected. Review test cases" + $true | Should -Be $false -Because "No Validation Selected. Review test cases" } } } diff --git a/Tests/Public/Invoke-ZertoMoveRollback.Tests.ps1 b/Tests/Public/Invoke-ZertoMoveRollback.Tests.ps1 index 53c3383..8e0b4fd 100644 --- a/Tests/Public/Invoke-ZertoMoveRollback.Tests.ps1 +++ b/Tests/Public/Invoke-ZertoMoveRollback.Tests.ps1 @@ -1,16 +1,16 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { Context "$global:function::Parameter Unit Tests" { - it "$global:function should have exactly 14 parameters defined" { - (get-command $global:function).Parameters.Count | Should -Be 14 + It "$global:function should have exactly 14 parameters defined" { + (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 -Type string[] Get-Command $global:function | Should -HaveParameter vpgName -Mandatory diff --git a/Tests/Public/Invoke-ZertoRestRequest.Tests.ps1 b/Tests/Public/Invoke-ZertoRestRequest.Tests.ps1 index f7a23d5..16ed79e 100644 --- a/Tests/Public/Invoke-ZertoRestRequest.Tests.ps1 +++ b/Tests/Public/Invoke-ZertoRestRequest.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { @@ -40,12 +40,12 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { It " parameter cannot be null or empty" -TestCases $ParameterValidationTestCases { param($ParameterName) $thisParameter = $thisCommand.Parameters[$ParameterName] - $thisParameter.Attributes.Where{ $_ -is [ValidateNotNullOrEmpty] }.Count | Should Be 1 + $thisParameter.Attributes.Where{ $_ -is [ValidateNotNullOrEmpty] }.Count | Should -Be 1 } It "Method parameter can only be 'GET', 'POST', 'PUT', 'DELETE'" { $thisParameter = $thisCommand.Parameters['method'] - $thisParameter.Attributes.Where{ $_ -is [ValidateSet] }.Count | Should Be 1 + $thisParameter.Attributes.Where{ $_ -is [ValidateSet] }.Count | Should -Be 1 $thisParameter.Attributes.Where{ $_ -is [ValidateSet] }.validValues -contains 'GET' | Should -BeTrue $thisParameter.Attributes.Where{ $_ -is [ValidateSet] }.validValues -contains 'PUT' | Should -BeTrue $thisParameter.Attributes.Where{ $_ -is [ValidateSet] }.validValues -contains 'POST' | Should -BeTrue diff --git a/Tests/Public/New-ZertoPairingToken.Tests.ps1 b/Tests/Public/New-ZertoPairingToken.Tests.ps1 index 51ccce7..8d69a2c 100644 --- a/Tests/Public/New-ZertoPairingToken.Tests.ps1 +++ b/Tests/Public/New-ZertoPairingToken.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { BeforeAll { diff --git a/Tests/Public/New-ZertoVpg.Tests.ps1 b/Tests/Public/New-ZertoVpg.Tests.ps1 index e6e6083..770482b 100644 --- a/Tests/Public/New-ZertoVpg.Tests.ps1 +++ b/Tests/Public/New-ZertoVpg.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/New-ZertoVpgSettingsIdentifier.Tests.ps1 b/Tests/Public/New-ZertoVpgSettingsIdentifier.Tests.ps1 index e6e6083..770482b 100644 --- a/Tests/Public/New-ZertoVpgSettingsIdentifier.Tests.ps1 +++ b/Tests/Public/New-ZertoVpgSettingsIdentifier.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Remove-ZertoPeerSite.Tests.ps1 b/Tests/Public/Remove-ZertoPeerSite.Tests.ps1 index e6e6083..770482b 100644 --- a/Tests/Public/Remove-ZertoPeerSite.Tests.ps1 +++ b/Tests/Public/Remove-ZertoPeerSite.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Remove-ZertoVpg.Tests.ps1 b/Tests/Public/Remove-ZertoVpg.Tests.ps1 index e6e6083..770482b 100644 --- a/Tests/Public/Remove-ZertoVpg.Tests.ps1 +++ b/Tests/Public/Remove-ZertoVpg.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Remove-ZertoVpgSettingsIdentifier.Tests.ps1 b/Tests/Public/Remove-ZertoVpgSettingsIdentifier.Tests.ps1 index e6e6083..770482b 100644 --- a/Tests/Public/Remove-ZertoVpgSettingsIdentifier.Tests.ps1 +++ b/Tests/Public/Remove-ZertoVpgSettingsIdentifier.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Resume-ZertoVpg.Tests.ps1 b/Tests/Public/Resume-ZertoVpg.Tests.ps1 index e6e6083..770482b 100644 --- a/Tests/Public/Resume-ZertoVpg.Tests.ps1 +++ b/Tests/Public/Resume-ZertoVpg.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Save-ZertoVpgSetting.Tests.ps1 b/Tests/Public/Save-ZertoVpgSetting.Tests.ps1 index e6e6083..770482b 100644 --- a/Tests/Public/Save-ZertoVpgSetting.Tests.ps1 +++ b/Tests/Public/Save-ZertoVpgSetting.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Set-ZertoAlert.Tests.ps1 b/Tests/Public/Set-ZertoAlert.Tests.ps1 index e6e6083..770482b 100644 --- a/Tests/Public/Set-ZertoAlert.Tests.ps1 +++ b/Tests/Public/Set-ZertoAlert.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Set-ZertoLicense.Tests.ps1 b/Tests/Public/Set-ZertoLicense.Tests.ps1 index e6e6083..770482b 100644 --- a/Tests/Public/Set-ZertoLicense.Tests.ps1 +++ b/Tests/Public/Set-ZertoLicense.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Set-ZertoUserCredential.Tests.ps1 b/Tests/Public/Set-ZertoUserCredential.Tests.ps1 index 4cca845..74cc8ac 100644 --- a/Tests/Public/Set-ZertoUserCredential.Tests.ps1 +++ b/Tests/Public/Set-ZertoUserCredential.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { InModuleScope -ModuleName ZertoApiWrapper { diff --git a/Tests/Public/Start-ZertoCloneVpg.Tests.ps1 b/Tests/Public/Start-ZertoCloneVpg.Tests.ps1 index e6e6083..770482b 100644 --- a/Tests/Public/Start-ZertoCloneVpg.Tests.ps1 +++ b/Tests/Public/Start-ZertoCloneVpg.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Start-ZertoFailoverTest.Tests.ps1 b/Tests/Public/Start-ZertoFailoverTest.Tests.ps1 index e6e6083..770482b 100644 --- a/Tests/Public/Start-ZertoFailoverTest.Tests.ps1 +++ b/Tests/Public/Start-ZertoFailoverTest.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Stop-ZertoCloneVpg.Tests.ps1 b/Tests/Public/Stop-ZertoCloneVpg.Tests.ps1 index e6e6083..770482b 100644 --- a/Tests/Public/Stop-ZertoCloneVpg.Tests.ps1 +++ b/Tests/Public/Stop-ZertoCloneVpg.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Stop-ZertoFailoverTest.Tests.ps1 b/Tests/Public/Stop-ZertoFailoverTest.Tests.ps1 index e6e6083..770482b 100644 --- a/Tests/Public/Stop-ZertoFailoverTest.Tests.ps1 +++ b/Tests/Public/Stop-ZertoFailoverTest.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Suspend-ZertoVpg.Tests.ps1 b/Tests/Public/Suspend-ZertoVpg.Tests.ps1 index e6e6083..770482b 100644 --- a/Tests/Public/Suspend-ZertoVpg.Tests.ps1 +++ b/Tests/Public/Suspend-ZertoVpg.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Uninstall-ZertoVra.Tests.ps1 b/Tests/Public/Uninstall-ZertoVra.Tests.ps1 index e6e6083..770482b 100644 --- a/Tests/Public/Uninstall-ZertoVra.Tests.ps1 +++ b/Tests/Public/Uninstall-ZertoVra.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/ZertoApiWrapper.Tests.ps1 b/Tests/ZertoApiWrapper.Tests.ps1 index bcbb9ca..0f398ae 100644 --- a/Tests/ZertoApiWrapper.Tests.ps1 +++ b/Tests/ZertoApiWrapper.Tests.ps1 @@ -1,5 +1,5 @@ #Requires -Modules Pester -$testPath = Split-Path -Parent $MyInvocation.MyCommand.Path +$testPath = Split-Path -Parent $PSCommandPath $docsPath = $testPath -replace 'Tests', 'docs' $modulePath = $testPath -replace 'Tests', 'ZertoApiWrapper' $module = Split-Path -Leaf $modulePath @@ -9,7 +9,7 @@ Describe "Module: $module" -Tags 'Unit' { Context "Module Configuration" { It "Has a root module file ($module.psm1)" { - "$modulePath\$module.psm1" | should -Exist + "$modulePath\$module.psm1" | Should -Exist } It "Is valid Powershell (Has no script errors)" { @@ -75,20 +75,20 @@ Describe "Module: $module" -Tags 'Unit' { $externalHelpFile | Should -Exist } - it "External Help file does not contain place holder values" { - $stubExist = Get-Content -Path $externalHelpFile | Where-Object {$_.Trim() -like '*{{*}}*'} + It "External Help file does not contain place holder values" { + $stubExist = Get-Content -Path $externalHelpFile | Where-Object { $_.Trim() -like '*{{*}}*' } if ($stubExist) { Write-Warning "Found a stub in the Markdown File $externalHelpFile" Write-Warning "$stubExist" } - $stubExist | should benullorempty + $stubExist | Should benullorempty } } It "Is an advanced function" { - $Function.FullName | should -FileContentMatch 'function' - $Function.FullName | should -FileContentMatch 'cmdletbinding' - $Function.FullName | should -FileContentMatch 'param' + $Function.FullName | Should -FileContentMatch 'function' + $Function.FullName | Should -FileContentMatch 'cmdletbinding' + $Function.FullName | Should -FileContentMatch 'param' } It "Is valid Powershell (Has no script errors)" { @@ -97,15 +97,15 @@ Describe "Module: $module" -Tags 'Unit' { $errors | Should -HaveCount 0 } - it "Has openbraces on the same line as the statement" { - $openingBracesExist = $contents | Where-Object {$_.Trim() -eq '{'} + It "Has openbraces on the same line as the statement" { + $openingBracesExist = $contents | Where-Object { $_.Trim() -eq '{' } if ($openingBracesExist) { Write-Warning "Found the following opening brances on their own line:" foreach ($openingBrace in $openingBracesExist) { Write-Warning "Opening Brace on it's own line - $openingBrace" } } - $openingBracesExist | should -BeNullOrEmpty + $openingBracesExist | Should -BeNullOrEmpty } } } diff --git a/ZertoApiWrapper.build.ps1 b/ZertoApiWrapper.build.ps1 index 197036c..1bafeee 100644 --- a/ZertoApiWrapper.build.ps1 +++ b/ZertoApiWrapper.build.ps1 @@ -31,9 +31,11 @@ task CheckPlatyPSInstalled { <# Synopsis: Ensure Pester is installed #> task CheckPesterInstalled { + Get-Module -Name Pester | Remove-Module -Force if ($null -eq (Get-Module -List Pester)) { - Install-Module -Scope CurrentUser -Repository PSGallery -Name Pester + Install-Module -Scope CurrentUser -Repository PSGallery -Name Pester -MaximumVersion 4.99 } + Import-Module -Name Pester -MaximumVersion 4.99 -Force } <# Synopsis: Ensure PSScriptAnalyzer is installed #>