Skip to content

Commit

Permalink
Merge pull request #3879 from ykuijs/Dev
Browse files Browse the repository at this point in the history
Fixes #3847
  • Loading branch information
NikCharlebois authored Nov 10, 2023
2 parents 5cc5d7c + 81c8046 commit b399edf
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 6 deletions.
10 changes: 7 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
30 changes: 28 additions & 2 deletions Tests/QA/Microsoft365DSC.Resources.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,35 @@ Describe -Name "Check schema for resource '<ResourceName>'" -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
}

}

0 comments on commit b399edf

Please sign in to comment.