From c96836c0008a9520df2987bc6377e00210de9c09 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Mon, 22 Jul 2019 21:46:31 -0400 Subject: [PATCH] Add Parameter Tests --- Tests/Public/Get-ZASite.Tests.ps1 | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Tests/Public/Get-ZASite.Tests.ps1 b/Tests/Public/Get-ZASite.Tests.ps1 index e6e6083..fd61b07 100644 --- a/Tests/Public/Get-ZASite.Tests.ps1 +++ b/Tests/Public/Get-ZASite.Tests.ps1 @@ -5,6 +5,17 @@ $global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[ 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 "zOrgIdentifier Parameter should be present and of 'String' Type" { + Get-Command $global:function | Should -HaveParameter zOrgIdentifier -Type String -Mandatory:$false + } + + It "zOrgIdentifier has the NotNullOrEmpty Validator" { + (Get-Command $global:function).Parameters['zOrgIdentifier'].Attributes.Where{ $_ -is [ValidateNotNullOrEmpty] }.Count | Should Be 1 + } }