diff --git a/DscResources/MSFT_RegistryResource/MSFT_RegistryResource.psm1 b/DscResources/MSFT_RegistryResource/MSFT_RegistryResource.psm1 index 93741b8..a6ae461 100644 --- a/DscResources/MSFT_RegistryResource/MSFT_RegistryResource.psm1 +++ b/DscResources/MSFT_RegistryResource/MSFT_RegistryResource.psm1 @@ -1423,58 +1423,6 @@ function Test-RegistryKeyValuesMatch return $registryKeyValuesMatch } -<# - .SYNOPSIS - Removes the specified registry key and child subkeys recursively. - - .PARAMETER RegistryKey - The registry key to remove. -#> -function Remove-RegistryKey -{ - [CmdletBinding()] - param - ( - [Parameter(Mandatory = $true)] - [Microsoft.Win32.RegistryKey] - $RegistryKey - ) - - $parentKeyName = Split-Path -Path $RegistryKey.Name -Parent - $targetKeyName = Split-Path -Path $RegistryKey.Name -Leaf - - $parentRegistryKey = Get-RegistryKey -RegistryKeyPath $parentKeyName -WriteAccessAllowed - - $null = $parentRegistryKey.DeleteSubKeyTree($targetKeyName) -} - -<# - .SYNOPSIS - Removes the specified value of the specified registry key. - This is a wrapper function for unit testing. - - .PARAMETER RegistryKey - The registry key to remove the default value of. -#> -function Remove-RegistryKeyValue -{ - [CmdletBinding()] - param - ( - [Parameter(Mandatory = $true)] - [Microsoft.Win32.RegistryKey] - $RegistryKey, - - [Parameter(Mandatory = $true)] - [ValidateNotNull()] - [AllowEmptyString()] - [System.String] - $RegistryKeyValueName - ) - - $null = $RegistryKey.DeleteValue($RegistryKeyValueName) -} - <# .SYNOPSIS Removes the default value of the specified registry key. diff --git a/Tests/Unit/MSFT_GroupResource.Tests.ps1 b/Tests/Unit/MSFT_GroupResource.Tests.ps1 index 5578b2d..acb50cf 100644 --- a/Tests/Unit/MSFT_GroupResource.Tests.ps1 +++ b/Tests/Unit/MSFT_GroupResource.Tests.ps1 @@ -119,7 +119,7 @@ Describe 'GroupResource Unit Tests' { } <# - Get-Group, Add-GroupMember, Remove-GroupMember, Clear-GroupMembers, Save-Group, + Get-Group, Add-GroupMember, Remove-GroupMember, Clear-GroupMember, Save-Group, Remove-Group, Find-Principal, and Remove-DisposableObject cannot be unit tested because they are wrapper functions for .NET class function calls. #> @@ -1225,7 +1225,7 @@ Describe 'GroupResource Unit Tests' { ( ) - Assert-MockCalled -CommandName 'Clear-GroupMembers' -Times 0 -Scope 'It' + Assert-MockCalled -CommandName 'Clear-GroupMember' -Times 0 -Scope 'It' Assert-MockCalled -CommandName 'Add-GroupMember' -Times 0 -Scope 'It' Assert-MockCalled -CommandName 'Remove-GroupMember' -Times 0 -Scope 'It' Assert-MockCalled -CommandName 'Save-Group' -Times 0 -Scope 'It' @@ -1258,7 +1258,7 @@ Describe 'GroupResource Unit Tests' { return $memberPrincipals } - Mock -CommandName 'Clear-GroupMembers' -MockWith { } + Mock -CommandName 'Clear-GroupMember' -MockWith { } Mock -CommandName 'Add-GroupMember' -MockWith { } Mock -CommandName 'Remove-GroupMember' -MockWith { } Mock -CommandName 'Remove-Group' -MockWith { } @@ -1495,7 +1495,7 @@ Describe 'GroupResource Unit Tests' { Assert-MockCalled -CommandName 'Get-PrincipalContext' Assert-MockCalled -CommandName 'Get-Group' -ParameterFilter { $GroupName -eq $script:testGroupName } Assert-MockCalled -CommandName 'Get-MembersAsPrincipalsList' -ParameterFilter { $Group.Name -eq $script:testGroupName } - Assert-MockCalled -CommandName 'Clear-GroupMembers' -ParameterFilter { $Group.Name -eq $script:testGroupName } + Assert-MockCalled -CommandName 'Clear-GroupMember' -ParameterFilter { $Group.Name -eq $script:testGroupName } Assert-MockCalled -CommandName 'Save-Group' -ParameterFilter { $Group.Name -eq $script:testGroupName } Assert-MockCalled -CommandName 'Remove-DisposableObject' }