Skip to content

Commit

Permalink
SqlServerMaxDop: Fix for #396 (#1644)
Browse files Browse the repository at this point in the history
- SqlMaxDop
  - Fixes issue #396. Added three return values in Get-Target resource.
  • Loading branch information
Fiander authored Dec 10, 2020
1 parent 3670e4d commit fdc7608
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 5 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Fixed

- SqlMaxDop
- Fixes ([issue #396](https://github.com/dsccommunity/SqlServerDsc/issues/396)).
Added three return values in Get-Target resource.

## [15.0.0] - 2020-12-06

### Added
Expand Down
12 changes: 7 additions & 5 deletions source/DSCResources/DSC_SqlMaxDop/DSC_SqlMaxDop.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,13 @@ function Get-TargetResource
}

$returnValue = @{
InstanceName = $InstanceName
ServerName = $ServerName
MaxDop = $currentMaxDop
IsActiveNode = $isActiveNode
InstanceName = $InstanceName
ServerName = $ServerName
MaxDop = $currentMaxDop
IsActiveNode = $isActiveNode
ProcessOnlyOnActiveNode = $null
Ensure = $null
DynamicAlloc = $null
}

$returnValue
Expand Down Expand Up @@ -358,4 +361,3 @@ function Get-SqlDscDynamicMaxDop
$dynamicMaxDop
}

Export-ModuleMember -Function *-TargetResource
6 changes: 6 additions & 0 deletions tests/Unit/DSC_SqlMaxDop.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,12 @@ try
$result.InstanceName | Should -Be $testParameters.InstanceName
}

It 'Should return $null for the remaining parameters' {
$result.ProcessOnlyOnActiveNode | Should -BeNullOrEmpty
$result.Ensure | Should -BeNullOrEmpty
$result.DynamicAlloc | Should -BeNullOrEmpty
}

It 'Should call the mock function Connect-SQL' {
Assert-MockCalled -CommandName Connect-SQL -Exactly -Times 1 -Scope Context
}
Expand Down

0 comments on commit fdc7608

Please sign in to comment.