File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed
Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -50,6 +50,29 @@ AfterAll {
5050}
5151
5252Describe ' Get-SqlDscCompatibilityLevel' - Tag ' Public' {
53+ Context ' When validating parameter sets' {
54+ It ' Should have the correct parameters in parameter set <ExpectedParameterSetName>' - ForEach @ (
55+ @ {
56+ ExpectedParameterSetName = ' ServerObject'
57+ ExpectedParameters = ' -ServerObject <Server> [<CommonParameters>]'
58+ }
59+ @ {
60+ ExpectedParameterSetName = ' Version'
61+ ExpectedParameters = ' -Version <Version> [<CommonParameters>]'
62+ }
63+ ) {
64+ $result = (Get-Command - Name ' Get-SqlDscCompatibilityLevel' ).ParameterSets |
65+ Where-Object - FilterScript { $_.Name -eq $ExpectedParameterSetName } |
66+ Select-Object - Property @ (
67+ @ { Name = ' ParameterSetName' ; Expression = { $_.Name } },
68+ @ { Name = ' ParameterListAsString' ; Expression = { $_.ToString () } }
69+ )
70+
71+ $result.ParameterSetName | Should - Be $ExpectedParameterSetName
72+ $result.ParameterListAsString | Should - Be $ExpectedParameters
73+ }
74+ }
75+
5376 Context ' When getting compatibility levels for a server object' {
5477 BeforeAll {
5578 $mockServerObject = New-Object - TypeName ' Microsoft.SqlServer.Management.Smo.Server'
You can’t perform that action at this time.
0 commit comments