diff --git a/Tests/Public/Import-ZertoVpg.Tests.ps1 b/Tests/Public/Import-ZertoVpg.Tests.ps1 index 50d2f9d..bd91e77 100644 --- a/Tests/Public/Import-ZertoVpg.Tests.ps1 +++ b/Tests/Public/Import-ZertoVpg.Tests.ps1 @@ -16,4 +16,24 @@ Describe $file.BaseName -Tag 'Unit' { $null = [System.Management.Automation.PSParser]::Tokenize($contents, [ref]$errors) $errors | Should -HaveCount 0 } -} \ No newline at end of file + + Context "$($file.BaseName)::Parameter Unit Tests" { + + It "Has a mandatory string array parameter for the settings file to import" { + Get-Command $file.BaseName | Should -HaveParameter settingsFile + Get-Command $file.BaseName | Should -HaveParameter settingsFile -Mandatory + Get-Command $file.BaseName | Should -HaveParameter settingsFile -Type String[] + } + + It "Will not accecpt a Null or Empty string for the settings file" { + {Import-ZertoVpg -settingsFile $null} | Should -Throw + {Import-ZertoVpg -settingsFile ""} | Should -Throw + {Import-ZertoVpg -settingsFile @()} | Should -Throw + } + + } + + Context "$($file.BaseName)::Function Unit Tests" { + + } +} diff --git a/ZertoApiWrapper/Public/Import-ZertoVpg.ps1 b/ZertoApiWrapper/Public/Import-ZertoVpg.ps1 index bbc45ef..48a72cc 100644 --- a/ZertoApiWrapper/Public/Import-ZertoVpg.ps1 +++ b/ZertoApiWrapper/Public/Import-ZertoVpg.ps1 @@ -8,6 +8,7 @@ function Import-ZertoVpg { ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true )] + [ValidateNotNullOrEmpty()] [Alias("FullName")] [string[]]$settingsFile )