Skip to content

Instantly share code, notes, and snippets.

@ChrisLGardner
Created April 30, 2019 07:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ChrisLGardner/54c0d3331fa21eb8ebb0687a83320e4c to your computer and use it in GitHub Desktop.
Save ChrisLGardner/54c0d3331fa21eb8ebb0687a83320e4c to your computer and use it in GitHub Desktop.
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