From d2a574d440bc9bb0382a9166838925b3c1d7f022 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Sun, 31 Mar 2019 21:51:36 -0400 Subject: [PATCH] Add parameter tests --- Tests/Public/Export-ZertoVpg.Tests.ps1 | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/Tests/Public/Export-ZertoVpg.Tests.ps1 b/Tests/Public/Export-ZertoVpg.Tests.ps1 index 50d2f9d..308f909 100644 --- a/Tests/Public/Export-ZertoVpg.Tests.ps1 +++ b/Tests/Public/Export-ZertoVpg.Tests.ps1 @@ -16,4 +16,20 @@ Describe $file.BaseName -Tag 'Unit' { $null = [System.Management.Automation.PSParser]::Tokenize($contents, [ref]$errors) $errors | Should -HaveCount 0 } + + it "has a mantatory string parameter for the output path" { + Get-Command $file.BaseName | Should -HaveParameter outputPath -Mandatory -Type String + } + + it "has a non-mandatory string array parameter for vpgName(s) to export" { + Get-Command $file.BaseName | Should -HaveParameter vpgName -Type String[] -Mandatory + } + + it "has a non-mandatory switch parameter to export all vpgs" { + Get-Command $file.BaseName | Should -HaveParameter allVpgs -Type Switch -Mandatory + } + + it "No defined vpgName or AllVpg switch should throw an error" { + {Export-ZertoVpg -outputPath "."} | Should -Throw + } } \ No newline at end of file