diff --git a/CHANGELOG.md b/CHANGELOG.md index b43777b491..958ddb0f81 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,13 +2,17 @@ # UNRELEASED +* AADRoleEligibilityScheduleRequest + * Fixed incorrect subclass MSFT_AADRoleEligibilityScheduleRequestScheduleRecurrenceRange for range property + FIXES [#3847](https://github.com/microsoft/Microsoft365DSC/issues/3847) * IntuneDeviceEnrollmentStatusPageWindows10 * Fix typo in the catch of Update-DeviceEnrollmentConfigurationPriority - Fixes [#3442](https://github.com/microsoft/Microsoft365DSC/issues/3442) - + FIXES [#3442](https://github.com/microsoft/Microsoft365DSC/issues/3442) * M365DSCDRGUTIL * Fix an issue where temporary parameters were not renamed during recursive call causing a Model Validation error during creation or update of a Graph resource - Fixes [#3582](https://github.com/microsoft/Microsoft365DSC/issues/3582) + FIXES [#3582](https://github.com/microsoft/Microsoft365DSC/issues/3582) +* MISC + * Added a QA check to test if all used subclasses actually exist in the MOF schema. # 1.23.1108.1 diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_AADRoleEligibilityScheduleRequest/MSFT_AADRoleEligibilityScheduleRequest.schema.mof b/Modules/Microsoft365DSC/DSCResources/MSFT_AADRoleEligibilityScheduleRequest/MSFT_AADRoleEligibilityScheduleRequest.schema.mof index be1c792e30..106add50dd 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_AADRoleEligibilityScheduleRequest/MSFT_AADRoleEligibilityScheduleRequest.schema.mof +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_AADRoleEligibilityScheduleRequest/MSFT_AADRoleEligibilityScheduleRequest.schema.mof @@ -1,5 +1,5 @@ [ClassVersion("1.0.0")] -class MSFT_AADRoleEligibilityScheduleRequestScheduleRange +class MSFT_AADRoleEligibilityScheduleRequestScheduleRecurrenceRange { [Required, Description("The date to stop applying the recurrence pattern. Depending on the recurrence pattern of the event, the last occurrence of the meeting may not be this date.")] String endDate; [Write, Description("The number of times to repeat the event. Required and must be positive if type is numbered.")] UInt32 numberOfOccurrences; diff --git a/Tests/QA/Microsoft365DSC.Resources.Tests.ps1 b/Tests/QA/Microsoft365DSC.Resources.Tests.ps1 index 445ae5a0bf..529e7530e5 100644 --- a/Tests/QA/Microsoft365DSC.Resources.Tests.ps1 +++ b/Tests/QA/Microsoft365DSC.Resources.Tests.ps1 @@ -104,9 +104,35 @@ Describe -Name "Check schema for resource ''" -ForEach $schemaFile } It 'Schema should have a Key parameter' { - $schema = Get-MofSchemaObject -FileName $FullName - $attributes = ($schema | Where-Object { [String]::IsNullOrEmpty($_.FriendlyName) -eq $false }).Attributes + $mofSchemas = Get-MofSchemaObject -FileName $FullName + $attributes = ($mofSchemas | Where-Object { [String]::IsNullOrEmpty($_.FriendlyName) -eq $false }).Attributes $keyCount = ($attributes | Where-Object { $_.State -eq 'Key' }).Count $keyCount | Should -BeGreaterThan 1 } + + It 'Schema should contain an instance of all used subclasses' { + $mofSchemas = Get-MofSchemaObject -FileName $FullName + + $errors = 0 + + $availableClasses = $mofSchemas.ClassName | Where-Object -FilterScript { $_ -ne $ResourceName } + + foreach ($mofSchema in $mofSchemas) + { + foreach ($attribute in $mofSchema.Attributes) + { + if ([String]::IsNullOrEmpty($attribute.EmbeddedInstance) -eq $false -and $attribute.EmbeddedInstance -ne "MSFT_Credential") + { + if ($attribute.EmbeddedInstance -notin $availableClasses) + { + Write-Host "[ERROR] Property $($attribute.Name) in class $($mofSchema.ClassName) / Specified EmbeddedInstance: $($attribute.EmbeddedInstance) not found!" -ForegroundColor Red + $errors++ + } + } + } + } + + $errors | Should -Be 0 + } + }