diff --git a/CHANGELOG.md b/CHANGELOG.md index 30a843a..7de5e1a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Added + +- Added a Test + Checks if the ResourceId ends with the []' has ResourceIDs ending with []" -TestCases $testCases { + if ($Skip) + { + Set-ItResult -Skipped -Because "Tests for '$DscResourceName' are skipped" + } + $mofContent = Get-Content -Raw -Path "$($OutputDirectory)\localhost_$dscResourceName.mof" + $selectString = Select-String -InputObject $mofContent -Pattern 'ResourceID = ".+' -AllMatches + foreach ($value in $selectString.Matches | Select-Object -ExpandProperty Value) + { + $value | Should -Match -RegularExpression "(ResourceID = `".*)(:{2}\[$DscResourceName\]$DscResourceName`";)" + } + } + AfterAll { Remove-Item -Path C:\Temp\JeaRoleTest.ps1 if (-not $tempExists)