Skip to content

Commit

Permalink
fix an issue with unit test due to $nullResult not being a clone of $…
Browse files Browse the repository at this point in the history
…PSBoundParameters
  • Loading branch information
William-Francillette committed Feb 26, 2024
1 parent b1c9e65 commit 4c4f312
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,7 @@ function Get-TargetResource
Add-M365DSCTelemetryEvent -Data $data
#endregion

$nullResult = @{
DisplayName = $DisplayName
}
$nullResult = ([Hashtable]$PSBoundParameters).clone()
$nullResult.Ensure = 'Absent'
try
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture {
}

It 'Should return absent from the Get method' {
(Get-TargetResource @testParams).Ensure | Should -Be 'Absent'
(Get-TargetResource @testParams ).Ensure | Should -Be 'Absent'
}

It 'Should return false from the Test method' {
Expand Down

0 comments on commit 4c4f312

Please sign in to comment.