Skip to content

Commit d8d9150

Browse files
committed
Update tests to include ServiceName to the Get-ReportingServicesData mocks
1 parent bced7c4 commit d8d9150

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

tests/Unit/DSC_SqlRS.Tests.ps1

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ Describe 'SqlRS\Get-TargetResource' -Tag 'Get' {
8787
$mockReportServerApplicationUrl = 'http://+:80'
8888
$mockVirtualDirectoryReportManagerName = 'Reports_SQL2016'
8989
$mockVirtualDirectoryReportServerName = 'ReportServer_SQL2016'
90+
$mockReportingServicesServiceName = 'SQLServerReportingServices'
9091

9192
$mockInvokeRsCimMethod_ListReservedUrls = {
9293
return New-Object -TypeName Object |
@@ -115,7 +116,8 @@ Describe 'SqlRS\Get-TargetResource' -Tag 'Get' {
115116
Add-Member -MemberType NoteProperty -Name 'InstanceName' -Value $mockNamedInstanceName -PassThru |
116117
Add-Member -MemberType NoteProperty -Name 'VirtualDirectoryReportServer' -Value $mockVirtualDirectoryReportServerName -PassThru |
117118
Add-Member -MemberType NoteProperty -Name 'VirtualDirectoryReportManager' -Value $mockVirtualDirectoryReportManagerName -PassThru |
118-
Add-Member -MemberType NoteProperty -Name 'SecureConnectionLevel' -Value $mockDynamicSecureConnectionLevel -PassThru -Force
119+
Add-Member -MemberType NoteProperty -Name 'SecureConnectionLevel' -Value $mockDynamicSecureConnectionLevel -PassThru -Force |
120+
Add-Member -MemberType NoteProperty -Name 'ServiceName' -Value $mockReportingServicesServiceName -PassThru -Force
119121
),
120122
(
121123
# Array is a regression test for issue #819.
@@ -418,6 +420,7 @@ Describe 'SqlRS\Set-TargetResource' -Tag 'Set' {
418420
$mockReportServerApplicationUrl = 'http://+:80'
419421
$mockVirtualDirectoryReportManagerName = 'Reports_SQL2016'
420422
$mockVirtualDirectoryReportServerName = 'ReportServer_SQL2016'
423+
$mockReportingServicesServiceName = 'SQLServerReportingServices'
421424

422425
$mockInvokeCimMethod = {
423426
throw 'Should not call Invoke-CimMethod directly, should call the wrapper Invoke-RsCimMethod.'
@@ -462,7 +465,8 @@ Describe 'SqlRS\Set-TargetResource' -Tag 'Set' {
462465
Add-Member -MemberType NoteProperty -Name 'InstanceName' -Value $mockNamedInstanceName -PassThru |
463466
Add-Member -MemberType NoteProperty -Name 'VirtualDirectoryReportServer' -Value $mockVirtualDirectoryReportServerName -PassThru |
464467
Add-Member -MemberType NoteProperty -Name 'VirtualDirectoryReportManager' -Value $mockVirtualDirectoryReportManagerName -PassThru |
465-
Add-Member -MemberType NoteProperty -Name 'SecureConnectionLevel' -Value $mockDynamicSecureConnectionLevel -PassThru -Force
468+
Add-Member -MemberType NoteProperty -Name 'SecureConnectionLevel' -Value $mockDynamicSecureConnectionLevel -PassThru -Force |
469+
Add-Member -MemberType NoteProperty -Name 'ServiceName' -Value $mockReportingServicesServiceName -PassThru -Force
466470
),
467471
(
468472
# Array is a regression test for issue #819.
@@ -483,7 +487,8 @@ Describe 'SqlRS\Set-TargetResource' -Tag 'Set' {
483487
Add-Member -MemberType NoteProperty -Name 'InstanceName' -Value $mockDefaultInstanceName -PassThru |
484488
Add-Member -MemberType NoteProperty -Name 'VirtualDirectoryReportServer' -Value '' -PassThru |
485489
Add-Member -MemberType NoteProperty -Name 'VirtualDirectoryReportManager' -Value '' -PassThru -Force |
486-
Add-Member -MemberType NoteProperty -Name 'SecureConnectionLevel' -Value $mockDynamicSecureConnectionLevel -PassThru -Force
490+
Add-Member -MemberType NoteProperty -Name 'SecureConnectionLevel' -Value $mockDynamicSecureConnectionLevel -PassThru -Force |
491+
Add-Member -MemberType NoteProperty -Name 'ServiceName' -Value $mockReportingServicesServiceName -PassThru -Force
487492
}
488493

489494
$mockGetCimInstance_ConfigurationSetting_ParameterFilter = {

0 commit comments

Comments
 (0)