Created
April 30, 2019 07:06
-
-
Save ChrisLGardner/54c0d3331fa21eb8ebb0687a83320e4c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function get-stuff { | |
param ( | |
[ValidateSet('A','b','c','d')] | |
[string]$user, | |
[ValidateNotNullOrEmpty()] | |
[string]$data | |
) | |
} | |
describe "check for validation" { | |
it "Should have validate set on User" { | |
(Get-Command Get-Stuff).Parameters['user'].Attributes.ValidValues | Should -Be 'A','b','c','d' | |
} | |
it "Should have validatenotnullorempty on data" { | |
(get-command get-stuff).parameters['data'].Attributes.TypeId.Name | Should -Contain 'ValidateNotNullOrEmptyAttribute' | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment