Skip to content

Commit

Permalink
Remove unneccesary test code in SqlRS
Browse files Browse the repository at this point in the history
  • Loading branch information
johlju committed Feb 18, 2022
1 parent 567cd8b commit 220b1f6
Showing 1 changed file with 0 additions and 37 deletions.
37 changes: 0 additions & 37 deletions tests/Unit/DSC_SqlRS.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -60,17 +60,12 @@ Describe 'SqlRS\Get-TargetResource' -Tag 'Get' {
$mockReportingServicesDatabaseDefaultInstanceName = $mockDefaultInstanceName

$mockReportsApplicationName = 'ReportServerWebApp'
$mockReportsApplicationNameLegacy = 'ReportManager'
$mockReportServerApplicationName = 'ReportServerWebService'
$mockReportsApplicationUrl = 'http://+:80'
$mockReportServerApplicationUrl = 'http://+:80'
$mockVirtualDirectoryReportManagerName = 'Reports_SQL2016'
$mockVirtualDirectoryReportServerName = 'ReportServer_SQL2016'

$mockInvokeCimMethod = {
throw 'Should not call Invoke-CimMethod directly, should call the wrapper Invoke-RsCimMethod.'
}

$mockInvokeRsCimMethod_ListReservedUrls = {
return New-Object -TypeName Object |
Add-Member -MemberType ScriptProperty -Name 'Application' -Value {
Expand All @@ -87,18 +82,6 @@ Describe 'SqlRS\Get-TargetResource' -Tag 'Get' {
} -PassThru -Force
}

$mockInvokeRsCimMethod_GenerateDatabaseCreationScript = {
return @{
Script = 'select * from something'
}
}

$mockInvokeRsCimMethod_GenerateDatabaseRightsScript = {
return @{
Script = 'select * from something'
}
}

$mockGetCimInstance_ConfigurationSetting_NamedInstance = {
return @(
(
Expand Down Expand Up @@ -134,30 +117,10 @@ Describe 'SqlRS\Get-TargetResource' -Tag 'Get' {
Add-Member -MemberType NoteProperty -Name 'SecureConnectionLevel' -Value $mockDynamicSecureConnectionLevel -PassThru -Force
}

$mockGetCimInstance_ConfigurationSetting_ParameterFilter = {
$ClassName -eq 'MSReportServer_ConfigurationSetting'
}

$mockGetCimInstance_Language = {
return @{
Language = '1033'
}
}

$mockGetCimInstance_OperatingSystem_ParameterFilter = {
$ClassName -eq 'Win32_OperatingSystem'
}

Mock -CommandName Invoke-RsCimMethod -MockWith $mockInvokeRsCimMethod_ListReservedUrls -ParameterFilter {
$MethodName -eq 'ListReservedUrls'
}

<#
This is mocked here so that no calls are made to it directly,
or if any mock of Invoke-RsCimMethod are wrong.
#>
Mock -CommandName Invoke-CimMethod -MockWith $mockInvokeCimMethod

InModuleScope -ScriptBlock {
$script:mockNamedInstanceName = 'INSTANCE'
$script:mockReportingServicesDatabaseServerName = 'SERVER'
Expand Down

0 comments on commit 220b1f6

Please sign in to comment.