Add comprehensive test suite, fix minor issues, rename function and file names to match approved verbs (#708)

This commit is contained in:
Jeffrey
2026-07-19 22:06:07 +02:00
committed by GitHub
parent a7292e4f35
commit 9c033dbf98
116 changed files with 4629 additions and 650 deletions
@@ -0,0 +1,21 @@
BeforeAll {
$friendlyTargetScriptPath = Join-Path $PSScriptRoot '..\Scripts\Helpers\Get-FriendlyRegistryBackupTarget.ps1'
. $friendlyTargetScriptPath
}
Describe 'Get-FriendlyRegistryBackupTarget' {
It 'formats <Case> as <Expected>' -ForEach @(
@{ Case = 'a null target'; Target = $null; Expected = 'Unknown' }
@{ Case = 'the default profile'; Target = 'DefaultUserProfile'; Expected = 'Default user profile' }
@{ Case = 'the current-user marker'; Target = 'CurrentUser'; Expected = 'Current user' }
@{ Case = 'the all-users marker'; Target = 'AllUsers'; Expected = 'All users' }
@{ Case = 'a named current user'; Target = 'CurrentUser:Alice'; Expected = 'Current user (Alice)' }
@{ Case = 'a named target user'; Target = 'User:Bob'; Expected = 'User (Bob)' }
) {
Get-FriendlyRegistryBackupTarget -Target $Target | Should -Be $Expected
}
It 'keeps unrecognized target text visible to the user' {
Get-FriendlyRegistryBackupTarget -Target 'Custom:Value' | Should -Be 'Custom:Value'
}
}