Skip to content

Commit

Permalink
Update common tests
Browse files Browse the repository at this point in the history
  • Loading branch information
X-Guardian committed Apr 19, 2020
1 parent 4d61abc commit 9cb4669
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions tests/Unit/ActiveDirectoryDsc.Common.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -1555,13 +1555,13 @@ InModuleScope 'ActiveDirectoryDsc.Common' {

Context 'When using parameter Properties and IgnoreProperties to compare desired values' {
BeforeAll {
$mockCurrentValues = [Ordered]@{
$mockCurrentValues = @{
ComputerName = 'DC01'
Location = 'Sweden'
Ensure = 'Present'
}

$mockDesiredValues = [Ordered]@{
$mockDesiredValues = @{
ComputerName = 'DC01'
Location = 'Europe'
Ensure = 'Absent'
Expand All @@ -1579,14 +1579,14 @@ InModuleScope 'ActiveDirectoryDsc.Common' {

$compareTargetResourceStateResult = Compare-ResourcePropertyState @compareTargetResourceStateParameters
$compareTargetResourceStateResult | Should -HaveCount 2
$compareTargetResourceStateResult[0].ParameterName | Should -Be 'Location'
$compareTargetResourceStateResult[0].Expected | Should -Be 'Europe'
$compareTargetResourceStateResult[0].Actual | Should -Be 'Sweden'
$compareTargetResourceStateResult[0].InDesiredState | Should -BeFalse
$compareTargetResourceStateResult[1].ParameterName | Should -Be 'ComputerName'
$compareTargetResourceStateResult[1].Expected | Should -Be 'DC01'
$compareTargetResourceStateResult[1].Actual | Should -Be 'DC01'
$compareTargetResourceStateResult[1].InDesiredState | Should -BeTrue
$computerNameResult = $compareTargetResourceStateResult | Where-Object -Property ParameterName -eq 'ComputerName'
$computerNameResult.Expected | Should -Be 'DC01'
$computerNameResult.Actual | Should -Be 'DC01'
$computerNameResult.InDesiredState | Should -BeTrue
$locationNameResult = $compareTargetResourceStateResult | Where-Object -Property ParameterName -eq 'Location'
$locationNameResult.Expected | Should -Be 'Europe'
$locationNameResult.Actual | Should -Be 'Sweden'
$locationNameResult.InDesiredState | Should -BeFalse
}
}

Expand Down

0 comments on commit 9cb4669

Please sign in to comment.