Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
NikCharlebois committed Jan 25, 2024
1 parent e7a996b commit 107d164
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ function Get-TargetResource
$ApplicationAccessPolicy = $null
try
{
$ApplicationAccessPolicy = Get-ApplicationAccessPolicy -Identity $Identity -ErrorAction Stop
[Array]$ApplicationAccessPolicy = Get-ApplicationAccessPolicy -Identity $Identity -ErrorAction Stop
Write-Verbose -Message "Found policy by Identity {$Identity}"
}
catch
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture {
Invoke-Command -ScriptBlock $Global:DscHelper.InitializeScript -NoNewScope

BeforeAll {
$Script:ExportMode = $false
$secpasswd = ConvertTo-SecureString 'test@password1' -AsPlainText -Force
$Credential = New-Object System.Management.Automation.PSCredential ('[email protected]', $secpasswd)

Expand Down Expand Up @@ -56,13 +57,7 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture {
}

Mock -CommandName Get-ApplicationAccessPolicy -MockWith {
return @{
Identity = 'DifferentApplicationAccessPolicy1'
AccessRight = 'DenyAccess'
AppID = '3dbc2ae1-7198-45ed-9f9f-d86ba3ec35b5'
ScopeIdentity = 'Engineering Staff'
Description = 'Engineering Group Policy'
}
return $null
}

Mock -CommandName Set-ApplicationAccessPolicy -MockWith {
Expand Down Expand Up @@ -101,13 +96,13 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture {
}

Mock -CommandName Get-ApplicationAccessPolicy -MockWith {
return @{
return @(@{
Identity = 'ApplicationAccessPolicy1'
AccessRight = 'DenyAccess'
AppID = '3dbc2ae1-7198-45ed-9f9f-d86ba3ec35b5'
ScopeIdentity = 'Engineering Staff'
Description = 'Engineering Group Policy'
}
})
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture {

It 'Should call the New- cmdlet' {
Set-TargetResource @testParams
Should -Invoke -CommandName 'New-DataClassification' -Exactly 1
}
}

Expand Down Expand Up @@ -107,7 +106,6 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture {

It 'Should set Call into the Set-DataClassification command exactly once' {
Set-TargetResource @testParams
Should -Invoke -CommandName 'Set-DataClassification' -Exactly 1
}
}

Expand Down Expand Up @@ -144,7 +142,6 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture {

It 'Should call into the Remove-DataClassification cmdlet once' {
Set-TargetResource @testParams
Should -Invoke -CommandName 'Remove-DataClassification' -Exactly 1
}
}

Expand Down

0 comments on commit 107d164

Please sign in to comment.