Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
sandrola committed Jan 8, 2025
1 parent 02ae0d6 commit ff3e577
Showing 1 changed file with 33 additions and 77 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,9 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture {
MemberType = "direct"
PrincipalDisplayName = "FakePrincipal"
ScheduleInfo = (New-CimInstance -ClassName MSFT_MicrosoftGraphRequestSchedule -Property @{
StartDateTime = '2025-01-23T08:59:28.1200000+00:00'
startDateTime = '2025-01-23T08:59:00.0000000+00:00'
Expiration = (New-CimInstance -ClassName MSFT_MicrosoftGraphExpirationPattern -Property @{
EndDateTime = '12/23/2025 8:59:00 AM +00:00'
EndDateTime = '23/12/2025 08:59:00 +00:00'
Type = 'afterDateTime'} -ClientOnly)
} -ClientOnly)
Ensure = "Present"
Expand Down Expand Up @@ -111,30 +111,23 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture {
MemberType = "direct"
PrincipalDisplayName = "FakePrincipal"
ScheduleInfo = (New-CimInstance -ClassName MSFT_MicrosoftGraphRequestSchedule -Property @{
StartDateTime = '2025-01-23T08:59:28.1200000+00:00'
startDateTime = '2025-01-23T08:59:00.0000000+00:00'
Expiration = (New-CimInstance -ClassName MSFT_MicrosoftGraphExpirationPattern -Property @{
EndDateTime = '12/23/2025 8:59:00 AM +00:00'
EndDateTime = '23/12/2025 08:59:00 +00:00'
Type = 'afterDateTime'} -ClientOnly)
} -ClientOnly)
Ensure = "Absent"
Credential = $Credential;
}

Mock -CommandName Get-MgIdentityGovernancePrivilegedAccessGroupEligibilitySchedule -MockWith {
return $null
}

mock -CommandName Get-MgGroup -MockWith {
return @{
AccessId = 'member'
GroupDisplayName = 'FakeStringValue'
MemberType = 'direct'
PrincipalDisplayName = 'FakePrincipal'
ScheduleInfo = @(
@{
StartDateTime = '2025-01-23T08:59:28.1200000+00:00'
Expiration = @{
EndDateTime = '12/23/2025 8:59:00 AM +00:00'
type = 'afterDateTime'
}
}
)
Id = 'FakeId'
DisplayName = 'FakeStringValue'
}
}

Expand All @@ -148,20 +141,16 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture {
GroupDisplayName = 'FakeStringValue'
MemberType = 'direct'
PrincipalDisplayName = 'FakePrincipal'
ScheduleInfo = @(
@{
StartDateTime = '2025-01-23T08:59:28.1200000+00:00'
ScheduleInfo = @{
StartDateTime = '2025-01-23T08:59:00.000Z'
Expiration = @{
EndDateTime = '12/23/2025 8:59:00 AM +00:00'
EndDateTime = '2025-12-23T08:59:00.000Z'
type = 'afterDateTime'
}
}
)
}
}
}
Mock -CommandName New-MgBetaIdentityGovernancePrivilegedAccessGroupEligibilityScheduleRequest -MockWith {
return $null
}

}

It 'Should return Values from the Get method' {
Expand All @@ -186,31 +175,17 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture {
MemberType = "direct"
PrincipalDisplayName = "FakePrincipal"
ScheduleInfo = (New-CimInstance -ClassName MSFT_MicrosoftGraphRequestSchedule -Property @{
StartDateTime = '2025-01-23T08:59:28.1200000+00:00'
startDateTime = '2025-01-23T08:59:00.0000000+00:00'
Expiration = (New-CimInstance -ClassName MSFT_MicrosoftGraphExpirationPattern -Property @{
EndDateTime = '12/23/2025 8:59:00 AM +00:00'
EndDateTime = '23/12/2025 08:59:00 +00:00'
Type = 'afterDateTime'} -ClientOnly)
} -ClientOnly)
Ensure = "Present"
Credential = $Credential;
}

Mock -CommandName Get-MgIdentityGovernancePrivilegedAccessGroupEligibilitySchedule -MockWith {
return @{
AccessId = 'member'
GroupDisplayName = 'FakeStringValue'
MemberType = 'direct'
PrincipalDisplayName = 'FakePrincipal'
ScheduleInfo = @(
@{
StartDateTime = '2025-01-23T08:59:28.1200000+00:00'
Expiration = @{
EndDateTime = '12/23/2025 8:59:00 AM +00:00'
type = 'afterDateTime'
}
}
)
}
return $null
}

mock -CommandName Get-MgGroup -MockWith {
Expand All @@ -227,9 +202,9 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture {
MemberType = 'direct'
PrincipalDisplayName = 'FakePrincipal'
ScheduleInfo = @{
StartDateTime = '2025-01-23T08:59:28.1200000+00:00'
StartDateTime = '2025-01-23T08:59:00.000Z'
Expiration = @{
EndDateTime = '12/23/2025 8:59:00 AM +00:00'
EndDateTime = '2025-12-23T08:59:00.000Z'
type = 'afterDateTime'
}
}
Expand Down Expand Up @@ -275,31 +250,17 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture {
MemberType = "direct"
PrincipalDisplayName = "FakePrincipal"
ScheduleInfo = (New-CimInstance -ClassName MSFT_MicrosoftGraphRequestSchedule -Property @{
StartDateTime = '2025-01-23T08:59:28.1200000+00:00'
startDateTime = '2025-01-23T08:59:00.0000000+00:00'
Expiration = (New-CimInstance -ClassName MSFT_MicrosoftGraphExpirationPattern -Property @{
EndDateTime = '12/23/2025 8:59:00 AM +00:00'
EndDateTime = '23/12/2025 08:59:00 +00:00'
Type = 'afterDateTime'} -ClientOnly)
} -ClientOnly)
Ensure = "Present"
Credential = $Credential;
}

Mock -CommandName Get-MgIdentityGovernancePrivilegedAccessGroupEligibilitySchedule -MockWith {
return @{
AccessId = 'member'
GroupDisplayName = 'FakeStringValue'
MemberType = 'direct'
PrincipalDisplayName = 'FakePrincipal'
ScheduleInfo = @(
@{
StartDateTime = '2025-01-23T08:59:28.1200000+00:00'
Expiration = @{
EndDateTime = '12/24/2025 8:59:00 AM +00:00'
type = 'afterDateTime'
}
}
)
}
return $null
}

mock -CommandName Get-MgGroup -MockWith {
Expand All @@ -316,9 +277,9 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture {
MemberType = 'direct'
PrincipalDisplayName = 'FakePrincipal'
ScheduleInfo = @{
StartDateTime = '2025-01-23T08:59:28.1200000+00:00'
StartDateTime = '2025-01-23T08:59:00.000Z'
Expiration = @{
EndDateTime = '12/23/2025 8:59:00 AM +00:00'
EndDateTime = '2025-12-22T08:59:00.000Z'
type = 'afterDateTime'
}
}
Expand Down Expand Up @@ -372,21 +333,16 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture {
Credential = $Credential
}

mock -CommandName Get-MgGroup -MockWith {
return @{
Id = 'FakeId'
DisplayName = 'FakeStringValue'
}
}

Mock -CommandName Get-MgIdentityGovernancePrivilegedAccessGroupEligibilitySchedule -MockWith {
return @{
AccessId = 'member'
GroupDisplayName = 'FakeStringValue'
MemberType = 'direct'
PrincipalDisplayName = 'FakePrincipal'
ScheduleInfo = @(
@{
StartDateTime = '2025-01-23T08:59:28.1200000+00:00'
Expiration = @{
EndDateTime = '12/23/2025 8:59:00 AM +00:00'
type = 'afterDateTime'
}
}
)
Id = 'FakeStringValue'
}
}
}
Expand Down

0 comments on commit ff3e577

Please sign in to comment.