Skip to content

Commit c245747

Browse files
Vasily LarionovVasily Larionov
authored andcommitted
Fixed MSFT_xComputer\Get-TargetResource test
Preserve order of reference and result arrays
1 parent c661535 commit c245747

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

Tests/Unit/MSFT_xComputer.Tests.ps1

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,9 @@ try
130130
It 'Should return a hashtable containing Name, DomainName, JoinOU, CurrentOU, Credential, UnjoinCredential and WorkGroupName' {
131131
$Result = Get-TargetResource -Name $env:COMPUTERNAME
132132
$Result.GetType().Fullname | Should Be 'System.Collections.Hashtable'
133-
$Result.Keys | Should Be @('Name', 'DomainName', 'JoinOU', 'CurrentOU', 'Credential', 'UnjoinCredential', 'WorkGroupName')
133+
$referenceKeys = @('Name', 'DomainName', 'JoinOU', 'CurrentOU', 'Credential', 'UnjoinCredential', 'WorkGroupName')|Sort-Object
134+
$resultKeys = $Result.Keys|Sort-Object
135+
$resultKeys | Should Be $referenceKeys
134136
}
135137
It 'Throws if name is to long' {
136138
{Get-TargetResource -Name "ThisNameIsTooLong"} | Should Throw

0 commit comments

Comments
 (0)