From 98aedca37316b091bbfa461c29199a5b43c46840 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Sun, 19 May 2019 16:24:39 -0500 Subject: [PATCH 1/4] Update Parameter Tests --- Tests/Public/Invoke-ZertoMoveCommit.Tests.ps1 | 9 +++++++++ Tests/Public/Invoke-ZertoMoveRollback.Tests.ps1 | 9 +++++++++ 2 files changed, 18 insertions(+) diff --git a/Tests/Public/Invoke-ZertoMoveCommit.Tests.ps1 b/Tests/Public/Invoke-ZertoMoveCommit.Tests.ps1 index 50d2f9d..89cf63f 100644 --- a/Tests/Public/Invoke-ZertoMoveCommit.Tests.ps1 +++ b/Tests/Public/Invoke-ZertoMoveCommit.Tests.ps1 @@ -16,4 +16,13 @@ Describe $file.BaseName -Tag 'Unit' { $null = [System.Management.Automation.PSParser]::Tokenize($contents, [ref]$errors) $errors | Should -HaveCount 0 } + + Context "$($file.BaseName)::Parameter Unit Tests" { + + it "has a mandatory string parameter for the vpgName" { + Get-Command $file.BaseName | Should -HaveParameter vpgName + Get-Command $file.BaseName | Should -HaveParameter vpgName -Type string[] + Get-Command $file.BaseName | Should -HaveParameter vpgName -Mandatory + } + } } \ No newline at end of file diff --git a/Tests/Public/Invoke-ZertoMoveRollback.Tests.ps1 b/Tests/Public/Invoke-ZertoMoveRollback.Tests.ps1 index 50d2f9d..89cf63f 100644 --- a/Tests/Public/Invoke-ZertoMoveRollback.Tests.ps1 +++ b/Tests/Public/Invoke-ZertoMoveRollback.Tests.ps1 @@ -16,4 +16,13 @@ Describe $file.BaseName -Tag 'Unit' { $null = [System.Management.Automation.PSParser]::Tokenize($contents, [ref]$errors) $errors | Should -HaveCount 0 } + + Context "$($file.BaseName)::Parameter Unit Tests" { + + it "has a mandatory string parameter for the vpgName" { + Get-Command $file.BaseName | Should -HaveParameter vpgName + Get-Command $file.BaseName | Should -HaveParameter vpgName -Type string[] + Get-Command $file.BaseName | Should -HaveParameter vpgName -Mandatory + } + } } \ No newline at end of file From 4de751bc3dabe397d70dee93e87d0e008a08c401 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Sun, 19 May 2019 16:52:36 -0500 Subject: [PATCH 2/4] Typo Fix --- ZertoApiWrapper/Public/Get-ZertoAlert.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ZertoApiWrapper/Public/Get-ZertoAlert.ps1 b/ZertoApiWrapper/Public/Get-ZertoAlert.ps1 index 1ee27f6..abd4571 100644 --- a/ZertoApiWrapper/Public/Get-ZertoAlert.ps1 +++ b/ZertoApiWrapper/Public/Get-ZertoAlert.ps1 @@ -43,7 +43,7 @@ function Get-ZertoAlert { [string]$endDate, [Parameter( ParameterSetName = "filter", - HelpMessage = "Returns alerts for the specified vraIdentifier" + HelpMessage = "Returns alerts for the specified vpgIdentifier" )] [ValidateNotNullOrEmpty()] [Alias("vpgId")] From 2465305ddf7d4cabcb323626221593b9677b2189 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Sun, 19 May 2019 16:52:44 -0500 Subject: [PATCH 3/4] Update Get-ZertoAlert.Tests.ps1 --- Tests/Public/Get-ZertoAlert.Tests.ps1 | 59 ++++++++++++++++++++++++++- 1 file changed, 57 insertions(+), 2 deletions(-) diff --git a/Tests/Public/Get-ZertoAlert.Tests.ps1 b/Tests/Public/Get-ZertoAlert.Tests.ps1 index 1367839..d3e1558 100644 --- a/Tests/Public/Get-ZertoAlert.Tests.ps1 +++ b/Tests/Public/Get-ZertoAlert.Tests.ps1 @@ -20,10 +20,65 @@ Describe $file.BaseName -Tag 'Unit' { Context "$($file.BaseName)::Parameter Unit Tests" { it "Has a mandatory string parameter for the Alert identifier" { - Get-Command $file.BaseName | Should -HaveParameter alertId -Mandatory -Type String[] + Get-Command $file.BaseName | Should -HaveParameter alertId + Get-Command $file.BaseName | Should -HaveParameter alertId -Mandatory + Get-Command $file.BaseName | Should -HaveParameter alertId -Type String[] } - } + it "Has a non-mandatory switch parameter for the entities" { + Get-Command $file.BaseName | Should -HaveParameter entities + Get-Command $file.BaseName | Should -HaveParameter entities -Type switch + } + it "Has a non-mandatory switch parameter for the helpIdentifiers" { + Get-Command $file.BaseName | Should -HaveParameter helpIdentifiers + Get-Command $file.BaseName | Should -HaveParameter helpIdentifiers -Type switch + } + + it "Has a non-mandatory switch parameter for the levels" { + Get-Command $file.BaseName | Should -HaveParameter levels + Get-Command $file.BaseName | Should -HaveParameter levels -Type switch + } + + it "Has a non-mandatory string parameter for the startDate" { + Get-Command $file.BaseName | Should -HaveParameter startDate + Get-Command $file.BaseName | Should -HaveParameter startDate -Type string + } + + it "Has a non-mandatory string parameter for the endDate" { + Get-Command $file.BaseName | Should -HaveParameter endDate + Get-Command $file.BaseName | Should -HaveParameter endDate -Type string + } + + it "Has a non-mandatory string parameter for the vpgIdentifier" { + Get-Command $file.BaseName | Should -HaveParameter vpgIdentifier + Get-Command $file.BaseName | Should -HaveParameter vpgIdentifier -Type string + } + + it "Has a non-mandatory string parameter for the siteIdentifier" { + Get-Command $file.BaseName | Should -HaveParameter siteIdentifier + Get-Command $file.BaseName | Should -HaveParameter siteIdentifier -Type string + } + + it "Has a non-mandatory string parameter for the zorgIdentifier" { + Get-Command $file.BaseName | Should -HaveParameter zorgIdentifier + Get-Command $file.BaseName | Should -HaveParameter zorgIdentifier -Type string + } + + it "Has a non-mandatory string parameter for the level" { + Get-Command $file.BaseName | Should -HaveParameter level + Get-Command $file.BaseName | Should -HaveParameter level -Type string + } + + it "Has a non-mandatory string parameter for the helpIdentifier" { + Get-Command $file.BaseName | Should -HaveParameter helpIdentifier + Get-Command $file.BaseName | Should -HaveParameter helpIdentifier -Type string + } + + it "Has a non-mandatory bool parameter for the isDismissed" { + Get-Command $file.BaseName | Should -HaveParameter isDismissed + Get-Command $file.BaseName | Should -HaveParameter isDismissed -Type bool + } + } } From 28c35115eb192da479d5f4976c8b345250d0c982 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Sun, 19 May 2019 17:01:36 -0500 Subject: [PATCH 4/4] Update Get-ZertoDatastore.Tests.ps1 --- Tests/Public/Get-ZertoDatastore.Tests.ps1 | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Tests/Public/Get-ZertoDatastore.Tests.ps1 b/Tests/Public/Get-ZertoDatastore.Tests.ps1 index 50d2f9d..294021f 100644 --- a/Tests/Public/Get-ZertoDatastore.Tests.ps1 +++ b/Tests/Public/Get-ZertoDatastore.Tests.ps1 @@ -16,4 +16,9 @@ Describe $file.BaseName -Tag 'Unit' { $null = [System.Management.Automation.PSParser]::Tokenize($contents, [ref]$errors) $errors | Should -HaveCount 0 } + + It "has a non-mandatory string parameter for the datacenterIdentifier" { + Get-Command $file.BaseName | Should -HaveParameter datastoreIdentifier + Get-Command $file.BaseName | Should -HaveParameter datastoreIdentifier -Type String[] + } } \ No newline at end of file