-
-
Notifications
You must be signed in to change notification settings - Fork 830
/
Copy pathCopy-DbaDataCollector.Tests.ps1
38 lines (34 loc) · 1.23 KB
/
Copy-DbaDataCollector.Tests.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#Requires -Module @{ ModuleName="Pester"; ModuleVersion="5.0"}
param(
$ModuleName = "dbatools",
$PSDefaultParameterValues = ($TestConfig = Get-TestConfig).Defaults
)
Write-Host -Object "Running $PSCommandPath" -ForegroundColor Cyan
Describe "Copy-DbaDataCollector" -Tag "UnitTests" {
Context "Parameter validation" {
BeforeAll {
$command = Get-Command Copy-DbaDataCollector
$expected = $TestConfig.CommonParameters
$expected += @(
'Source',
'SourceSqlCredential',
'Destination',
'DestinationSqlCredential',
'CollectionSet',
'ExcludeCollectionSet',
'NoServerReconfig',
'Force',
'EnableException',
'Confirm',
'WhatIf'
)
}
It "Has parameter: <_>" -ForEach $expected {
$command | Should -HaveParameter $PSItem
}
It "Should have exactly the number of expected parameters ($($expected.Count))" {
$hasparms = $command.Parameters.Values.Name
Compare-Object -ReferenceObject $expected -DifferenceObject $hasparms | Should -BeNullOrEmpty
}
}
}