mirror of
https://github.com/Raphire/Win11Debloat.git
synced 2026-11-26 07:26:18 +01:00
refactor(tests): streamline test cases
This commit is contained in:
@@ -100,26 +100,6 @@ Describe 'Get-SelectedRegistryFeaturesForBackupValidation' {
|
||||
}
|
||||
}
|
||||
|
||||
Describe 'Test-RegistryValueKindNameSupported' {
|
||||
It 'accepts supported registry value kind <KindName>' -ForEach @(
|
||||
@{ KindName = 'dword' }
|
||||
@{ KindName = 'QWord' }
|
||||
@{ KindName = 'MultiString' }
|
||||
) {
|
||||
Test-RegistryValueKindNameSupported -KindName $KindName | Should -BeTrue
|
||||
}
|
||||
|
||||
It 'rejects <Case>' -ForEach @(
|
||||
@{ Case = 'a null kind name'; KindName = $null }
|
||||
@{ Case = 'an empty kind name'; KindName = '' }
|
||||
@{ Case = 'the Unknown registry kind'; KindName = 'Unknown' }
|
||||
@{ Case = 'the unsupported None registry kind'; KindName = 'None' }
|
||||
@{ Case = 'an invalid registry kind name'; KindName = 'NotARegistryValueKind' }
|
||||
) {
|
||||
Test-RegistryValueKindNameSupported -KindName $KindName | Should -BeFalse
|
||||
}
|
||||
}
|
||||
|
||||
Describe 'Test-RegistryValueDataMatchesKind' {
|
||||
It 'accepts <Case>' -ForEach @(
|
||||
@{ Case = 'the largest DWord'; Kind = 'DWord'; Data = [uint32]::MaxValue }
|
||||
@@ -156,11 +136,11 @@ Describe 'Get-NormalizedRegistryValueName' {
|
||||
}
|
||||
|
||||
Describe 'Test-RegistryValueKindNameSupported' {
|
||||
It 'rejects unsupported kind <KindName>' -ForEach @('99', '-2', 'Unknown', 'None', '') {
|
||||
It 'rejects unsupported kind <KindName>' -ForEach @('99', '-2', 'Unknown', 'None', '', $null, 'NotARegistryValueKind') {
|
||||
Test-RegistryValueKindNameSupported -KindName $_ | Should -BeFalse
|
||||
}
|
||||
|
||||
It 'accepts defined kind <KindName>' -ForEach @('String', 'expandstring', 'Binary', 'DWord', 'QWord', 'MultiString', '1') {
|
||||
It 'accepts defined kind <KindName>' -ForEach @('String', 'expandstring', 'Binary', 'DWord', 'dword', 'QWord', 'MultiString', '1') {
|
||||
Test-RegistryValueKindNameSupported -KindName $_ | Should -BeTrue
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user