Skip to content

Commit

Permalink
Update Microsoft365DSC.IntuneAppConfigurationPolicy.Tests.ps1
Browse files Browse the repository at this point in the history
  • Loading branch information
NikCharlebois committed Sep 16, 2021
1 parent 43d7372 commit e26dfa7
Showing 1 changed file with 11 additions and 11 deletions.
Expand Up @@ -37,11 +37,11 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture {
return "Credential"
}

Mock -CommandName Update-IntuneAppConfigurationPolicyTargeted -MockWith {
Mock -CommandName Update-MgDeviceAppManagementTargetedManagedAppConfiguration -MockWith {
}
Mock -CommandName New-IntuneAppConfigurationPolicyTargeted -MockWith {
Mock -CommandName New-MgDeviceAppManagementTargetedManagedAppConfiguration -MockWith {
}
Mock -CommandName Remove-IntuneAppConfigurationPolicyTargeted -MockWith {
Mock -CommandName Remove-MgDeviceAppManagementTargetedManagedAppConfiguration -MockWith {
}
}

Expand All @@ -55,7 +55,7 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture {
GlobalAdminAccount = $GlobalAdminAccount;
}

Mock -CommandName Get-IntuneAppConfigurationPolicyTargeted -MockWith {
Mock -CommandName Get-MgDeviceAppManagementTargetedManagedAppConfiguration -MockWith {
return $null
}
}
Expand All @@ -70,7 +70,7 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture {

It "Should create the App Configuration Policy from the Set method" {
Set-TargetResource @testParams
Should -Invoke -CommandName "New-IntuneAppConfigurationPolicyTargeted" -Exactly 1
Should -Invoke -CommandName "New-MgDeviceAppManagementTargetedManagedAppConfiguration" -Exactly 1
}
}

Expand All @@ -83,7 +83,7 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture {
GlobalAdminAccount = $GlobalAdminAccount;
}

Mock -CommandName Get-IntuneAppConfigurationPolicyTargeted -MockWith {
Mock -CommandName Get-MgDeviceAppManagementTargetedManagedAppConfiguration -MockWith {
return @{
DisplayName = 'Test App Configuration Policy'
Description = 'Different Value'
Expand All @@ -102,7 +102,7 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture {

It "Should update the App Configuration Policy from the Set method" {
Set-TargetResource @testParams
Should -Invoke -CommandName Update-IntuneAppConfigurationPolicyTargeted -Exactly 1
Should -Invoke -CommandName Update-MgDeviceAppManagementTargetedManagedAppConfiguration -Exactly 1
}
}

Expand All @@ -115,7 +115,7 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture {
GlobalAdminAccount = $GlobalAdminAccount;
}

Mock -CommandName Get-IntuneAppConfigurationPolicyTargeted -MockWith {
Mock -CommandName Get-MgDeviceAppManagementTargetedManagedAppConfiguration -MockWith {
return @{
DisplayName = 'Test App Configuration Policy'
Description = 'Test Definition'
Expand All @@ -137,7 +137,7 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture {
GlobalAdminAccount = $GlobalAdminAccount;
}

Mock -CommandName Get-IntuneAppConfigurationPolicyTargeted -MockWith {
Mock -CommandName Get-MgDeviceAppManagementTargetedManagedAppConfiguration -MockWith {
return @{
DisplayName = 'Test App Configuration Policy'
Description = 'Test Definition'
Expand All @@ -156,7 +156,7 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture {

It "Should remove the App Configuration Policy from the Set method" {
Set-TargetResource @testParams
Should -Invoke -CommandName Remove-IntuneAppConfigurationPolicyTargeted -Exactly 1
Should -Invoke -CommandName Remove-MgDeviceAppManagementTargetedManagedAppConfiguration -Exactly 1
}
}

Expand All @@ -166,7 +166,7 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture {
GlobalAdminAccount = $GlobalAdminAccount;
}

Mock -CommandName Get-IntuneAppConfigurationPolicyTargeted -MockWith {
Mock -CommandName Get-MgDeviceAppManagementTargetedManagedAppConfiguration -MockWith {
return @{
DisplayName = 'Test App Configuration Policy'
Description = 'Test Definition'
Expand Down

0 comments on commit e26dfa7

Please sign in to comment.