Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sandrola committed Mar 18, 2024
1 parent a053480 commit 5f4763b
Showing 1 changed file with 68 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture {
Description = 'FakeStringValue'
Enabled = $True
DisableComplianceRecordingAudioNotificationForCalls = $True
ComplianceRecordingApplications = @('123456')
Identity = 'FakeStringValue'
Ensure = 'Absent'
Credential = $Credential
Expand All @@ -106,14 +105,29 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture {
Description = 'FakeStringValue'
Enabled = $True
DisableComplianceRecordingAudioNotificationForCalls = $True
ComplianceRecordingApplications = "Microsoft.Teams.Policy.Aministration.Cmdlets.Core.CompianceRecordingApplication"
ComplianceRecordingApplications = @(
@{
Id = '00000000-0000-0000-0000-000000000000'
ComplianceRecordingPairedApplications = @()
ConcurrentInvitationCount = 1
RequiredDuringCall = $True
RequiredBeforeMeetingJoin = $True
RequiredBeforeCallEstablishment = $True
RequiredDuringMeeting = $True
}
)
Identity = 'FakeStringValue'
}
}
Mock -CommandName Get-CsTeamsComplianceRecordingApplication -MockWith {
return @{
Identity = 'FakeStringValue/123456'
Id = '123456'
Id = '00000000-0000-0000-0000-000000000000'
ComplianceRecordingPairedApplications = @()
ConcurrentInvitationCount = 1
RequiredDuringCall = $True
RequiredBeforeMeetingJoin = $True
RequiredBeforeCallEstablishment = $True
RequiredDuringMeeting = $True
}
}

Expand All @@ -123,9 +137,7 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture {
$Result = (Get-TargetResource @testParams)
$Result.Ensure | Should -Be 'Present'
$Result.ComplianceRecordingApplications.Length | Should -Be 1
$Result.ComplianceRecordingApplications[0] | Should -Be '123456'
Should -Invoke -CommandName Get-CsTeamsComplianceRecordingPolicy -Exactly 1
Should -Invoke -CommandName Get-CsTeamsComplianceRecordingApplication -ParameterFilter {$Filter -eq 'FakeStringValue/*'} -Exactly 1

}

Expand All @@ -146,7 +158,6 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture {
Description = 'FakeStringValue'
Enabled = $True
DisableComplianceRecordingAudioNotificationForCalls = $True
ComplianceRecordingApplications = @('123456')
Identity = 'FakeStringValue'
Ensure = 'Present'
Credential = $Credential
Expand All @@ -158,15 +169,29 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture {
Description = 'FakeStringValue'
Enabled = $True
DisableComplianceRecordingAudioNotificationForCalls = $True
ComplianceRecordingApplications = "Microsoft.Teams.Policy.Aministration.Cmdlets.Core.CompianceRecordingApplication"
ComplianceRecordingApplications = @(
@{
Id = '00000000-0000-0000-0000-000000000000'
ComplianceRecordingPairedApplications = @()
ConcurrentInvitationCount = 1
RequiredDuringCall = $True
RequiredBeforeMeetingJoin = $True
RequiredBeforeCallEstablishment = $True
RequiredDuringMeeting = $True
}
)
Identity = 'FakeStringValue'

}
}
Mock -CommandName Get-CsTeamsComplianceRecordingApplication -MockWith {
return @{
Identity = 'FakeStringValue/123456'
Id = '123456'
Id = '00000000-0000-0000-0000-000000000000'
ComplianceRecordingPairedApplications = @()
ConcurrentInvitationCount = 1
RequiredDuringCall = $True
RequiredBeforeMeetingJoin = $True
RequiredBeforeCallEstablishment = $True
RequiredDuringMeeting = $True
}
}
}
Expand All @@ -191,18 +216,33 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture {
Mock -CommandName Get-CsTeamsComplianceRecordingPolicy -MockWith {
return @{
WarnUserOnRemoval = $False
Description = 'FakeStringValueDrift' #Drift
Enabled = $False
DisableComplianceRecordingAudioNotificationForCalls = $False
ComplianceRecordingApplications = "Microsoft.Teams.Policy.Aministration.Cmdlets.Core.CompianceRecordingApplication"
Description = 'FakeStringValue'
Enabled = $True
DisableComplianceRecordingAudioNotificationForCalls = $True
ComplianceRecordingApplications = @(
@{
Id = '00000000-0000-0000-0000-000000000000'
ComplianceRecordingPairedApplications = @()
ConcurrentInvitationCount = 1
RequiredDuringCall = $True
RequiredBeforeMeetingJoin = $True
RequiredBeforeCallEstablishment = $True
RequiredDuringMeeting = $True
}
)
Identity = 'FakeStringValue'
}
}

Mock -CommandName Get-CsTeamsComplianceRecordingApplication -MockWith {
return @{
Identity = 'FakeStringValue/123456Drift'
Id = '123456Drift' #Drift
Id = '00000000-0000-0000-0000-000000000000'
ComplianceRecordingPairedApplications = @()
ConcurrentInvitationCount = 1
RequiredDuringCall = $True
RequiredBeforeMeetingJoin = $True
RequiredBeforeCallEstablishment = $True
RequiredDuringMeeting = $True
}
}
}
Expand Down Expand Up @@ -235,18 +275,20 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture {
Description = 'FakeStringValue'
Enabled = $True
DisableComplianceRecordingAudioNotificationForCalls = $True
ComplianceRecordingApplications = "Microsoft.Teams.Policy.Aministration.Cmdlets.Core.CompianceRecordingApplication"
ComplianceRecordingApplications = @(
@{
Id = '00000000-0000-0000-0000-000000000000'
ComplianceRecordingPairedApplications = @()
ConcurrentInvitationCount = 1
RequiredDuringCall = $True
RequiredBeforeMeetingJoin = $True
RequiredBeforeCallEstablishment = $True
RequiredDuringMeeting = $True
}
)
Identity = 'FakeStringValue'

}
}
Mock -CommandName Get-CsTeamsComplianceRecordingApplication -MockWith {
return @{
Identity = 'FakeStringValue/123456'
Id = '123456'
}
}

}

It 'Should Reverse Engineer resource from the Export method' {
Expand Down

0 comments on commit 5f4763b

Please sign in to comment.