From 4e7d30ef332bf8c8605234c74f53a839e7cdbe8e Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Tue, 23 Jul 2019 12:30:30 -0400 Subject: [PATCH] Add NullOrEmpty validation test --- Tests/Public/Get-ZertoDatastore.Tests.ps1 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Tests/Public/Get-ZertoDatastore.Tests.ps1 b/Tests/Public/Get-ZertoDatastore.Tests.ps1 index 6727a99..5deb346 100644 --- a/Tests/Public/Get-ZertoDatastore.Tests.ps1 +++ b/Tests/Public/Get-ZertoDatastore.Tests.ps1 @@ -10,6 +10,10 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { Get-Command $global:function | Should -HaveParameter datastoreIdentifier Get-Command $global:function | Should -HaveParameter datastoreIdentifier -Type String[] } + + It "datastoreIdentifier parameter does not take null or empty values" { + (Get-Command $global:function).Parameters['datastoreIdentifier'].Attributes.Where{ $_ -is [ValidateNotNullOrEmpty] }.count | Should Be 1 + } } Context "$global:function::Parameter Functional Tests" {